如何在android XML文件中制作垂直对齐按钮android,如图像
问问题
923 次
3 回答
2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="fill_parent"></Button>
</LinearLayout>
使用 fill_parent 作为 layout_height。为OK你可以把它设为O下面的K,但是像上图一定要用背景图。
于 2011-07-19T04:25:37.557 回答
0
您可以增加高度和减少宽度,这样按钮的大小就会按照您想要的方式出现,并且对于“好的”事情,您必须将其创建为背景图像。
于 2011-07-19T04:21:55.080 回答
0
如果你使用 android:background 并在 drawables 中放置这样一个按钮的图片,你可以制作它,例如:
android:background="@drawable/my_button"
于 2011-07-19T17:47:24.580 回答