我设计我的应用程序的用户界面。我需要一个布局是这样的:
I'm designing my application UI. I need a layout looks like this:
(小于和>按钮)。问题是,我不知道如何来确保的TextView将填补剩余的空间,有两个按钮具有固定大小。
(< and > are Buttons). The problem is, I don't know how to make sure the TextView will fill the remaining space, with two buttons have fixed size.
如果我用FILL_PARENT的文本视图,无法显示在第二个按钮(>)。
If I use fill_parent for Text View, the second button (>) can't be shown.
感谢您的阅读。
如果你使用RelativeLayout的,你可以做这样的事情:
if you use RelativeLayout, you can do it something like this:
<RelativeLayout
android:layout_width = "fill_parent"
android:layout_height = "fill_parent">
<ImageView
android:id = "@+id/my_image"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:layout_alignParentTop ="true" />
<RelativeLayout
android:id="@+id/layout_bottom"
android:layout_width="fill_parent"
android:layout_height = "50dp"
android:layout_alignParentBottom = "true">
<Button
android:id = "@+id/but_left"
android:layout_width = "80dp"
android:layout_height = "wrap_content"
android:text="<"
android:layout_alignParentLeft = "true"/>
<TextView
android:layout_width = "fill_parent"
android:layout_height = "wrap_content"
android:layout_toLeftOf = "@+id/but_right"
android:layout_toRightOf = "@id/but_left" />
<Button
android:id = "@id/but_right"
android:layout_width = "80dp"
android:layout_height = "wrap_content"
android:text=">"
android:layout_alignParentRight = "true"/>
</RelativeLayout>
</RelativeLayout>
上一篇:MapFragment在滚动型MapFragment
下一篇:自全球应用课间与&QUOT; android.app.Application不能转换到&QUOT;课间、全球、QUOT、Application