购物车布局
来源:互联网 发布:海关总署稽查司的数据 编辑:程序博客网 时间:2024/06/16 15:42
主布局
<RelativeLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.bwie.month_demo.view.ShopcartActivity"> <ScrollView android:layout_above="@+id/relative_progress" android:layout_width="match_parent" android:layout_alignParentTop="true" android:layout_height="match_parent"> <com.bwie.month_demo.view.custom.CartExpanableListview android:id="@+id/expanable_listview" android:layout_width="match_parent" android:layout_height="wrap_content"></com.bwie.month_demo.view.custom.CartExpanableListview> </ScrollView> <RelativeLayout android:visibility="gone" android:id="@+id/relative_progress" android:layout_above="@+id/line" android:layout_width="match_parent" android:layout_height="match_parent"> <ProgressBar android:layout_width="60dp" android:layout_height="60dp" android:layout_centerInParent="true" /> </RelativeLayout> <LinearLayout android:id="@+id/line" android:layout_alignParentBottom="true" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="50dp"> <CheckBox android:layout_marginLeft="10dp" android:button="@null" android:background="@drawable/check_box_selector" android:id="@+id/check_all" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/text_total" android:text="合计:¥0.00" android:layout_weight="2" android:layout_width="0dp" android:layout_height="wrap_content" /> <TextView android:text="去结算(0)" android:background="#ff0000" android:textColor="#ffffff" android:gravity="center" android:id="@+id/text_buy" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent" /> </LinearLayout></RelativeLayout>
子布局
<LinearLayout android:orientation="horizontal" xmlns:android="http://schemas.android.com/apk/res/android" android:padding="10dp" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:id="@+id/rel" android:layout_toLeftOf="@+id/text_delete" android:layout_width="match_parent" android:layout_height="match_parent"> <CheckBox android:layout_centerVertical="true" android:id="@+id/check_child" android:button="@null" android:background="@drawable/check_box_selector" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ImageView android:id="@+id/image_good" android:layout_centerVertical="true" android:layout_toRightOf="@+id/check_child" android:layout_marginLeft="10dp" android:layout_width="80dp" android:layout_height="80dp" /> <TextView android:id="@+id/text_title" android:layout_toRightOf="@+id/image_good" android:layout_marginLeft="10dp" android:layout_alignTop="@+id/image_good" android:maxLines="2" android:minLines="2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:id="@+id/text_price" android:layout_toRightOf="@+id/image_good" android:layout_marginLeft="10dp" android:layout_alignBottom="@+id/image_good" android:text="¥99.99" android:textColor="#ff0000" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <LinearLayout android:layout_alignParentRight="true" android:layout_alignBottom="@+id/image_good" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:id="@+id/text_jian" android:text="一" android:padding="5dp" android:background="@drawable/bian_kuang_line" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:gravity="center" android:id="@+id/text_num" android:paddingLeft="10dp" android:paddingRight="10dp" android:background="@drawable/bian_kuang_line" android:layout_width="wrap_content" android:layout_height="match_parent" /> <TextView android:id="@+id/text_add" android:text="十" android:padding="5dp" android:background="@drawable/bian_kuang_line" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </RelativeLayout> <TextView android:layout_centerHorizontal="true" android:layout_marginLeft="3dp" android:layout_alignParentRight="true" android:layout_alignTop="@+id/rel" android:layout_alignBottom="@+id/rel" android:id="@+id/text_delete" android:background="#ff0000" android:text="删除" android:gravity="center" android:textColor="#ffffff" android:layout_width="50dp" android:layout_height="match_parent" /></LinearLayout>
全选布局
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:gravity="center_vertical" android:padding="10dp" android:layout_width="match_parent" android:layout_height="match_parent"> <CheckBox android:button="@null" android:background="@drawable/check_box_selector" android:id="@+id/check_group" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_marginLeft="10dp" android:text="京东自营" android:id="@+id/text_group" android:layout_width="wrap_content" android:layout_height="wrap_content" /></LinearLayout>
自定义布局
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:drawable="@drawable/shopping_cart_checked"/> <item android:state_checked="false" android:drawable="@drawable/shopping_cart_none_check"/> <item android:drawable="@drawable/shopping_cart_none_check"/></selector>
自定义边框布局
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffffff" /> <stroke android:width="0.1dp" android:color="#000000" /></shape>
自定义二级列表
public class CartExpanableListview extends ExpandableListView { public CartExpanableListview(Context context) { super(context); } public CartExpanableListview(Context context, AttributeSet attrs) { super(context, attrs); } public CartExpanableListview(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int height = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE>>2,MeasureSpec.AT_MOST); super.onMeasure(widthMeasureSpec, height); }}
阅读全文
0 0
- 购物车布局
- 购物车布局
- 购物车布局
- 布局二级购物车
- 二级购物车布局
- 一级购物车布局
- 购物车的布局
- 购物车视图布局
- 购物车布局+代码
- 完整购物车布局
- 购物车布局
- 购物车的布局
- 购物车订单布局
- 简单购物车的布局
- 购物车一级列表布局
- 购物车布局主页面
- 二级列表+购物车布局
- 网络加载购物车布局
- Linux下动态链接库管理
- webservice结合spring实现restful风格
- Tomcat开启APR运行模式,优化并发性能
- 利用UDP实现多用户客户聊天系统
- gRPC Name Resolution
- 购物车布局
- idea2017 jboss7.1.1final初次部署web项目(图文)
- linux 组播接收和发送代码和组播问题总结
- Oracle从dmp中导入一张表
- 进程调度API之preempt_count_add/preempt_count_sub
- Linuxer-"Linux开发者自己的媒体"第五月稿件和赠书名单
- php7新特性
- 数据结构实验之排序一:一趟快排
- 171220---LAMP Apache用户认证, 域名跳转 ,Apache访问日志