<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:clipChildren="false" | |
android:paddingTop="?android:attr/actionBarSize"> | |
<!-- | |
注意事项: | |
1.在布局的根节点设置该属性android:clipChildren | |
2.子節點是LinearLayout和FrameLayout才起作用,如果換成RelativeLayout就沒有效果 | |
--> | |
<FrameLayout | |
android:layout_width="match_parent" | |
android:layout_height="50dip" > | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="300dp" | |
android:scaleType="center" | |
android:src="@drawable/fo_7" | |
/> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="300dp" | |
android:text="clipchildren=false" | |
android:textColor="@android:color/white" | |
/> | |
</FrameLayout> | |
<!--<RelativeLayout | |
android:layout_width="match_parent" | |
android:layout_height="100dp" | |
android:background="#7F95C2"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="clipchildren=true" | |
android:textColor="@android:color/white" | |
/> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:scaleType="fitCenter" | |
android:src="@drawable/fo_7" | |
/> | |
</RelativeLayout>--> | |
</LinearLayout> |
android:clipChildren
最新推荐文章于 2022-03-15 16:19:47 发布