请教一个android界面排版的问题

MarkZar 2012-04-06 11:56:12
界面就是这样的:

现在用的main.xml如下:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width = "fill_parent"
android:layout_height = "wrap_content"
android:stretchColumns = "1">

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<TextView
android:text = "@string/number_prefix"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
<EditText
android:id = "@+id/EditPrefix"
android:inputType = "number"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
</TableRow>

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<TextView
android:text = "@string/password"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
<EditText
android:id = "@+id/EditPassword"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
</TableRow>

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<TextView
android:text = "@string/province"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
<EditText
android:id = "@+id/EditProvince"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
</TableRow>

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<TextView
android:text = "@string/start_number"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
<EditText
android:id = "@+id/EditStart"
android:inputType = "number"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
</TableRow>

<TableRow
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<Button
android:id = "@+id/Login"
android:text = "@string/login"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />

</TableRow>

</TableLayout>

“登录”按钮感觉太窄了点,想把它变得跟整个界面一样宽,怎么实现?改了很长时间都没成功
...全文
286 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
MarkZar 2012-04-06
  • 打赏
  • 举报
回复
自己搞定了,把Button的那个<TableRow>去掉就可以了
life02 2012-04-06
  • 打赏
  • 举报
回复
恩,大部分问题都是自己解决的
丿渎灬魂 2012-04-06
  • 打赏
  • 举报
回复
。 lin..layout 布局就可以了。

80,493

社区成员

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

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