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" />    

更多相关文章

  1. c# webservice中访问http和https的wsdl以及生成配置节点的不同之
  2. go语言如何删除链表节点
  3. java对XML文件的解析、节点的增加、删除操作总结
  4. XML(4)XDocument和XmlDocument搜索指定的节点
  5. xml学习(7) .net 获取xml节点或者属性最大值
  6. FireFox对XML的处理兼容IE的节点处理方法
  7. 读写xml所有节点个人小结 和 读取xml节点的数据总结
  8. 详解XML命名空间(XML Namespaces)介绍以及节点读取方法的示例代码
  9. xml创建根节点、子节点的示例代码分享

随机推荐

  1. Android实现LIstView条目单选和多选Radio
  2. Android(安卓)GridLayout 的 columnSpan
  3. android button 透明背景色
  4. android 文本走马灯代码
  5. Android(安卓)使用 TableLayout 布局拉伸
  6. Android(安卓)GridLayout 的 columnSpan
  7. 相对布局的各个含义
  8. Android:theme
  9. android在Gridview实现Textview跑马灯效
  10. Gridview的stretchMode详解附自动宽度