android按鈕的位置
Ⅰ android編程中怎麼將一個按鈕置於最上層
可以用相對布局RelativeLayout,給RelativeLayout一個id,
然後按鈕按RelativeLayout作為父控制項進行相對布局,從而置於最上層。
代碼部分:
<?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>
註:此按鈕會在最上層的右下位置 因為
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
想更改成其它位置,改變令你想處的位置基於父控制項,如左上:
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
Ⅱ Android三個點選項按鈕在手機導航欄最右下角,如何改位置到最頂部標題欄里
第一步:打開手機桌面設置中的【便捷輔助】選項,
第二步:點擊進入【導航鍵】,
第三步:點擊【虛擬按鍵】,根據個人使用習慣選擇一種按鍵方式即可。