我有一個Viewgroup作爲包含背景圖像的相關佈局的父級佈局。我將動態添加到relativelayout並可以縮放和滾動它。當我改變方向時,背景圖像縮小以適應風景。我想按照背景圖像的比例更改相關佈局控件。 Iam新手到Android,所以不清楚從哪裏開始?android-根據背景圖像按比例改變佈局
佈局
<com.example.pdoc.zoomablepdf.ZoomableViewGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foregroundGravity="center"
android:id="@+id/zoomLayout"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="@drawable/sample1pdf"
android:id="@+id/RelLayout">
</RelativeLayout>
</com.example.pdoc.zoomablepdf.ZoomableViewGroup>
其實我只是想相稱的控制WRT背景圖片,所以我不能爲創造一個不同的佈局......怎麼把背景圖像也會動態變化,控件動態添加 –