TableLayout 的layout_gravity问题

a156435646 2015-01-09 11:50:45

<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="0,1" >
<TableRow
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@color/test">
<Button
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Button01"
android:text="SHORT1"
android:background="@color/test1"
/>
<Button
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/Button02"
android:text="SHORT2"
android:background="@color/test2"
/>
</TableRow>
</TableLayout>



那么问题来了,为什么右边的button显示文字不全?如何才能像左边一样?
...全文
117 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
a156435646 2015-01-09
  • 打赏
  • 举报
回复
好吧,没人知道吗?我公布答案好了 android:layout_marginLeft="14dp" android:layout_marginRight="14dp" 把这两句从TableRow放到TableLayout     就OK了     <TableLayout                xmlns:android="http://schemas.android.com/apk/res/android"            xmlns:tools="http://schemas.android.com/tools"           android:layout_width="fill_parent"                 android:layout_height="fill_parent" android:layout_marginLeft="14dp" android:layout_marginRight="14dp"         android:stretchColumns="0,1" > 至于为什么,我觉得应该从源码找才能知道。。mark下吧
a156435646 2015-01-09
  • 打赏
  • 举报
回复
木有人来解决这个问题吗= =主流都不喜欢这个布局好像。。

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧