我对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
也许你有你的布局的根视图填充 –
此屏幕 –