使用 TableLayout 时屏幕右侧出现烦人的线条

发布于 2024-09-01 22:22:50 字数 272 浏览 2 评论 0原文

我正在为 Activity 使用 TableLayout,如果 TableRow 数量超过一定数量,屏幕右侧会出现一条垂直线。

替代文本 http://dl.dropbox.com/u/5342899/device.png< /a>

如果我在布局中使用较少的视图,该行就会消失。如果这不是错误,我应该在布局中查找问题?

I'm using a TableLayout for an Activity and if I have more than a certain number of TableRows a vertical line appears to the right of the screen.

alt text http://dl.dropbox.com/u/5342899/device.png

If I use fewer Views in my layout, the line disappears. If this is not a bug, where should I look in my layout for problems?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

撩动你心 2024-09-08 22:22:51

它是一个滚动条。当您的布局比屏幕长时就会出现。您可以在 TableLayout 上禁用它(XML 中的 android:scrollbars="none" 或代码中的 setVerticalScrollBarEnabled(false))。
但是,您不应该这样做,因为如果添加太多行,用户根本看不到它们。
如果滚动条隐藏文本,请向布局添加填充 (android:padding="10dip")。

It is a scrollbar. It appears when your layout is longer than the screen. You can disable it on your TableLayout (android:scrollbars="none" in XML or setVerticalScrollBarEnabled(false) from code).
However, you shouldn't do that because if you add too much rows, the user simply won't see them.
If the scrollbar hides text, add a padding to the layout (android:padding="10dip").

烟沫凡尘 2024-09-08 22:22:51

当您超过一定数量的行时出现该行的原因是因为它是一个 ScrollBar,这意味着屏幕上的行数向下流动到可见页面下方,滚动条允许用户向其余部分做出手势选项。

同样,这也是为什么当只有几行时,栏会消失,有足够的空间可以正确显示行。

The reason the line appears when you have over a certain amount of rows is because it is a ScrollBar, it means the amount of rows on your screen flow down below the visible page, the scroll bar allows the user to gesture towards the rest of the options.

In the same respect it's also why the bar disappears when there only a few rows, there's enough room for the rows to be shown correctly.

余生共白头 2024-09-08 22:22:51

请记住,如果您禁用滚动条并打算在其他手机上部署该应用程序(尤其是屏幕较小的手机),您将面临从用户那里删除部分 UI 的风险

Bear in mind that if you disable the scrollbar and intend on deploying the app on other phones - especially phones with smaller screens - you run the risk of cutting out part of the UI from users

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文