我想在自定義縮放視圖的下方放置相對佈局。我不想讓相對佈局的內容獲得縮放。我想要一個按鈕放置在相對佈局的中心。在自定義縮放視圖下方的相對佈局中放置一個按鈕
這裏是我的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/images">
<com.example.acer.myapplication.ZoomView
android:id="@+id/iop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/twentyfive" />
</LinearLayout>
爲什麼要使用相對佈局和創建嵌套佈局?您可以簡單地將按鈕放在zoomView下方,因爲您是linearLayout –