画面の幅のパーセンテージだけを占有したいレイアウトがあります (左の画像)。現在、私の相対レイアウトはディスプレイの幅全体に広がっています (右の画像)。左右に余白があるように修正するにはどうすればよいですか?
これは、相対レイアウトを定義した方法です。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@color/white"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">