android:clipChildren属性,子布局超出父布局;

时间:2023-03-09 04:52:38
android:clipChildren属性,子布局超出父布局;

是否允许子View超出父View的范围,Boolean型true 、false ,默认true不允许;

android:clipChildren="true":如下

android:clipChildren属性,子布局超出父布局;

android:clipChildren="false":如下

android:clipChildren属性,子布局超出父布局;

代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:clipChildren="false"
android:layout_height="match_parent"> <RelativeLayout
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:clipChildren="false"
android:background="#ffffff"> <RadioGroup
android:id="@+id/rg"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#ffffff"
android:clipChildren="false"
android:gravity="bottom"
android:orientation="horizontal"> <RadioButton
android:id="@+id/rb_home"
style="@style/main_tab_button"
android:drawableTop="@drawable/rgbtn_home_select"
android:text="主页"/> <RadioButton
android:id="@+id/rb_shoppingcart"
style="@style/main_tab_button"
android:drawableTop="@drawable/rgbtn_gouwuche_select"
android:text="购物车"/>
<ImageView
android:id="@+id/iv"
android:layout_width="0dp"
android:layout_weight="1"
android:src="@mipmap/ic_launcher_round"
android:layout_height="68dp" /> <RadioButton
android:id="@+id/rb_orderfrom"
style="@style/main_tab_button"
android:drawableTop="@drawable/rgbtn_orderfrom_select"
android:text="分类"/> <RadioButton
android:id="@+id/rb_my"
style="@style/main_tab_button"
android:drawableTop="@drawable/rgbtn_my_select"
android:text="个人"/>
</RadioGroup>
<View
style="@style/Line_e0e0e0_Horizontal"/>
</RelativeLayout>
<FrameLayout
android:id="@+id/fl"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/rl"
></FrameLayout>
</RelativeLayout>