android:clipChildrenサブエレメントが親エレメントペイント領域を超えています

22739 ワード

1、ルートノードでandroidを設定する:clipChildrenをfalseにデフォルトでtrue 2、android:layout_gravityは、超えた部分がどのように表示されるかを制御します.
3、android:clipChildren:子Viewを制限するかどうかはその描画範囲内で試してみました.一般的に範囲外のview親要素はLinearlayoutですが、RelativeLayoutはだめなようです.自分が料理が多すぎるのではないでしょうか.
 
   
  
xml version="1.0" encoding="utf-8"?>
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false">

            android:id="@+id/lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="40dp"
        android:clipChildren="true"
        android:clipToPadding="false"
        android:divider="@android:color/black"
        android:dividerHeight="1dp"
        android:paddingTop="?attr/actionBarSize"
        android:visibility="visible"/>

            android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:visibility="visible"
        app:title="sss"
        app:titleTextColor="@android:color/white"/>

            android:id="@+id/llBottom"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:background="@android:color/darker_gray"
        android:orientation="horizontal">

                    android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:src="@mipmap/ic_launcher"/>

                    android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:src="@mipmap/ic_launcher"/>

                    android:layout_width="0dp"
            android:layout_height="90dp"
            android:layout_gravity="bottom"
            android:layout_weight="1"
            android:src="@mipmap/ic_launcher"/>

                    android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:src="@mipmap/ic_launcher"/>

                    android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:src="@mipmap/ic_launcher"/>

    
xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false">

            android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/tan"/>


            android:id="@+id/goodscat_toolbar"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_alignParentBottom="true"
        android:background="@color/txtcolor">

                    android:layout_width="0dp"
            android:layout_height="50dp"
            android:layout_gravity="bottom"
            android:layout_weight="0.2">

                            android:id="@+id/goodscat_shopping_img"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="@dimen/dimen_5_dp"
                android:src="@mipmap/shopping_cart" />

                            android:id="@+id/goodscat_shoppingnum"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignRight="@id/goodscat_shopping_img"
                android:background="@drawable/shape_shopping_cart"
                android:gravity="center"
                android:text="25"
                android:textColor="@color/white"
                android:textSize="8sp" />

        

                    android:id="@+id/goodscat_price"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.3"
            android:gravity="center"
            android:text="¥12.58"
            android:textColor="@color/white"
            android:textSize="18sp" />


                    android:id="@+id/goodscat_settlement"
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:background="@color/colorAccent"
            android:gravity="center"
            android:text="  "
            android:textColor="@color/white"
            android:textSize="16sp" />