Android自定义圆角矩形
来源:互联网 发布:gta5捏脸数据女可爱 编辑:程序博客网 时间:2024/05/21 15:44
【声明】转载请注明出处,此文出自指尖飞落的博客:http://blog.csdn.net/huntersnail
——尊重作者,知识无价,交流无限!
这个很简单没什么好说的,笔者也是记录一下,方便下次使用!1、/frxs/res/drawable/shape_add2cart.xml圆角矩形
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#F15353"/><corners android:radius="8px"/></shape>
2、/frxs/res/layout/item_good2.xml文件
<?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:background="@color/white" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" android:gravity="center" android:orientation="horizontal" android:padding="5dp" > <ImageView android:id="@+id/good_img" android:layout_width="90dp" android:layout_height="90dp" android:scaleType="centerCrop" android:src="@drawable/icon_default" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:orientation="vertical" > <TextView android:id="@+id/good_title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/padding_inner" android:layout_marginRight="@dimen/padding_inner" android:ellipsize="end" android:maxLines="2" android:textColor="@color/text_black" android:textSize="@dimen/size_good" /> <TextView android:id="@+id/good_discount" android:layout_width="wrap_content" android:layout_height="20dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginLeft="3dp" android:layout_marginRight="3dp" android:layout_marginTop="5dp" android:background="@drawable/shape_promotion_2" android:ellipsize="end" android:gravity="center" android:paddingLeft="5dp" android:paddingRight="5dp" android:singleLine="true" android:text="直降" android:textColor="@android:color/white" android:textSize="@dimen/size_price" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/padding_inner" android:layout_marginTop="5dp" android:gravity="center_vertical" android:orientation="horizontal" > <TextView android:id="@+id/good_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" android:singleLine="true" android:text="¥200" android:textColor="#db251f" android:textSize="@dimen/size_good2" /> <TextView android:id="@+id/good_oldprice" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_weight="1" android:ellipsize="end" android:singleLine="true" android:text="¥300" android:textColor="@color/tab_uncheck" android:textSize="@dimen/size_oldprice" /> <TextView android:id="@+id/good_buy" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="3dp" android:background="@drawable/shape_add2cart" android:ellipsize="end" android:gravity="center" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="3dp" android:paddingBottom="3dp" android:drawableLeft="@drawable/icon_jiaru" android:singleLine="true" android:text="加入" android:textColor="@android:color/white" android:textSize="@dimen/size_price" /> </LinearLayout> </LinearLayout> </LinearLayout></LinearLayout>
3、效果图
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆转载请注明出处☞指尖飞落的博客☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
0 0
- Android自定义圆角矩形
- Android自定义圆角矩形
- Android自定义圆角矩形图片ImageView
- android 使用shape自定义圆角矩形
- android自定义圆角矩形Imageview
- Android自定义按钮之圆角矩形
- Android开发之自定义圆角矩形进度对话框
- android editText 自定义为圆角矩形背景
- Android 自定义 RoundImageView 实现圆角矩形或圆形图片
- Android开发之自定义圆角矩形图片ImageView
- Android 自定义Drawable 实现圆角矩形和圆形图片
- 自定义圆角矩形、圆形
- 自定义圆角矩形---BitmapShader
- 自定义圆角矩形View
- 自定义圆角矩形控件
- Android 圆角矩形
- 自定义ImageView实现圆角矩形
- 自定义控件,圆角矩形(drawRoundRect)
- 瑞士轮
- js前端3des加密 后台java解密
- cnblog的高人
- Android基础:Activity生命周期细化
- 基于64位CentOS6.4安装JDK8.0
- Android自定义圆角矩形
- 数字统计问题
- 使用BND工具把普通JAR变成OSGI插件
- 斜率优化模板
- 电信宽带没有路由器也能上无线网
- linux 下搭建Nginx+php报错open_basedir restriction in effect. File(/var/www/html/index.php) is not within
- linux磁盘文件与目录管理系统(2)
- eclipse相似代码方法快捷键
- Nim游戏博弈