我對Android Studios相當陌生,所以很抱歉,如果這可能是一個愚蠢的問題。 我試圖把兩個按鈕放在我的屏幕上。我希望他們像這張圖片一樣在左上角和右下角。將按鈕放在屏幕的左上角
然而,這是他們的樣子。
我不想在屏幕的頂部和兩個按鍵之間的任何空間。這是我的代碼.. 的LinearLayout
<LinearLayout
android:layout_marginTop="0dp"
android:id="@+id/LinearLayout02"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/settingsBTN"
android:layout_weight="1"
android:src="@drawable/HomeBTNunpressed"/>
<View android:layout_width="3dp"
android:layout_height="50dp"
android:background="@android:color/black"/>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="50dp"
android:id="@+id/homeBTN"
android:layout_weight="1"
android:src="@drawable/settingsBTNunpressed"/>
</LinearLayout>
這可能會幫助:http://stackoverflow.com/questions/17960599/how-to-remove-padding-around-buttons-in-android – smoggers
也許你有你的佈局的根視圖填充 –
此屏幕 –