Android 表格布局管理器
我正在为这个应用程序使用 tableLayout,我试图让它看起来像这样
http ://i698.photobucket.com/albums/vv350/hoosierfan24/appLayout.png
但是我无法让它看起来像那样,并且这是我的问题。当我尝试将第二个按钮添加到第一行时,该按钮放置在另一个按钮的下方,而不是沿着它的一侧。如何更改它以使按钮与另一个按钮并排显示?
<?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="fill_parent"
android:stretchColumns="*">
<TableRow>
<Button android:marqueeRepeatLimit="marquee_forever"
android:layout_height="74dp" android:id="@+id/button1"
android:visibility="visible" android:text="Next Picture"
android:linksClickable="true" android:background="@raw/arrow"
android:layout_width="122dp"></Button>
<Button android:marqueeRepeatLimit="marquee_forever"
android:layout_height="74dp" android:id="@+id/button3"
android:visibility="visible" android:text="xxxx"
android:linksClickable="true" android:background="@raw/arrow2"
android:layout_width="122dp"></Button>
</TableRow>
<TableRow>
<ImageView android:id="@+id/imageView1"
android:keepScreenOn="true" android:src="@raw/img1"
android:layout_height="328sp" android:layout_width="323sp"
android:hapticFeedbackEnabled="false"></ImageView>
</TableRow>
<TableRow>
<Button android:text="Previous Picture" android:onClick="prevPicHandler"
android:marqueeRepeatLimit="marquee_forever" android:linksClickable="true"
android:visibility="visible" android:background="@raw/arrow2"
android:layout_width="122dp" android:layout_height="74dp"
android:id="@+id/button2"></Button>
</TableRow>
</TableLayout>
I am using a tableLayout for this application and I am trying to have it look like this
http://i698.photobucket.com/albums/vv350/hoosierfan24/appLayout.png
however I cant get it to look like that, and that is my problem. When I attempt to add a second button into the first row, the button is placed underneath the other button not along side of it. How can I change it to make the button appear along side the other?
<?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="fill_parent"
android:stretchColumns="*">
<TableRow>
<Button android:marqueeRepeatLimit="marquee_forever"
android:layout_height="74dp" android:id="@+id/button1"
android:visibility="visible" android:text="Next Picture"
android:linksClickable="true" android:background="@raw/arrow"
android:layout_width="122dp"></Button>
<Button android:marqueeRepeatLimit="marquee_forever"
android:layout_height="74dp" android:id="@+id/button3"
android:visibility="visible" android:text="xxxx"
android:linksClickable="true" android:background="@raw/arrow2"
android:layout_width="122dp"></Button>
</TableRow>
<TableRow>
<ImageView android:id="@+id/imageView1"
android:keepScreenOn="true" android:src="@raw/img1"
android:layout_height="328sp" android:layout_width="323sp"
android:hapticFeedbackEnabled="false"></ImageView>
</TableRow>
<TableRow>
<Button android:text="Previous Picture" android:onClick="prevPicHandler"
android:marqueeRepeatLimit="marquee_forever" android:linksClickable="true"
android:visibility="visible" android:background="@raw/arrow2"
android:layout_width="122dp" android:layout_height="74dp"
android:id="@+id/button2"></Button>
</TableRow>
</TableLayout>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为为此你应该使用 LinearLayouts 代替。像这样:
I think for this you should use LinearLayouts instead. Like this: