我需要你的幫助。
我有一個圖像(例如http://www.gif.tv/tv.png),我想在它的中間放置我的相對佈局。帶背景圖像的定位元素Android
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fbutton="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@null">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="12dp"
android:paddingLeft="29dp"
android:paddingRight="35dp"
android:paddingTop="70dp"
android:paddingBottom="70dp"
android:background="@drawable/phone2">
問題是,當屏幕更改大小時,relativelayout太大/太小。
如何使relativelayout始終處於屏幕大小的任何位置?
由於您提供給佈局的填充量會造成問題。 –
使用android:src =「@ drawable/phone」的ImageView,而不是RelativeLayout。 – natario
爲什麼你有兩個嵌套佈局? –