2012-11-21 78 views

回答

0

使用的FrameLayout作爲主容器和所有的元素將使用內部邊距:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" > 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/image" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_marginLeft="30dp" 
     android:layout_marginTop="60dp" 
     android:text="A text" 
     /> 

</FrameLayout>