2017-09-25 55 views

回答

0

你可以有一個直接的孩子。現在在頂部佈局中使用背景透明和填充,並且只將內容放在佈局內

<RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/parent_view" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/transparent" 
      android:paddingLeft="20dp" 
      android:paddingRight="20dp" 
      android:paddingBottom="20dp"> 
    <FrameLayout> 
     Content here 
    </FrameLayout></RelativeLayout> 

適用於我。

相關問題