android编程中怎么将一个按钮置于最上层
android编程中怎么将一个按钮置于最上层
[解决办法]
楼上说的FrameLayout不能自定义控件的位置。可以这样是先,你可以用相对布局RelativeLayout;然后给他一个id;然后再写那个按钮时把他相对的父控件式这个相对布局的id;下面是按钮总在最上层的右下角:
- XML code
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/webMainLayout" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnRegister" android:layout_alignBottom="@id/webMainLayout" android:layout_alignParentRight="true" android:layout_alignParentBottom="true" android:text="切换邮箱" /></RelativeLayout>