android ImageView实现上面圆角下面直角(xml实现方法)
来源:互联网 发布:fastjson与json 编辑:程序博客网 时间:2024/04/28 10:05
主要思想,用一个上面有两个圆角的图片覆盖在imageview上
主xml布局:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="6dp"> <ImageView android:id="@+id/ms_iv_activity" android:layout_width="match_parent" android:layout_height="132dp" android:layout_centerHorizontal="true" android:scaleType="center" android:src="@drawable/ms_ic_default" /> <View android:id="@+id/ms_iv_blank" android:layout_width="match_parent" android:layout_height="132dp" android:background="@drawable/ms_img_bg" /></RelativeLayout>
view中的ms_imge_bg是一个在drawable文件夹中的xml
<?xml version="1.0" encoding="utf-8"?><layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <stroke android:width="4dp" android:color="#f0f0f0" /> </shape> </item> <item> <shape android:shape="rectangle"> <corners android:topLeftRadius="6dp" android:topRightRadius="6dp" /> <stroke android:width="4dp" android:color="#f0f0f0" /> </shape> </item></layer-list>
注:ms_ic_defaul是图片地址可以自己定义
0 0
- android ImageView实现上面圆角下面直角(xml实现方法)
- Android实现Imageview上面圆角下面直角效果
- android上面圆角,下面直角 ImageView
- android ImageView实现上面圆角下面直角(自定义view实现)
- Android 自定义上面圆角下面直角的ImageView
- 安卓imageview实现上面两个圆角下面两个直角的效果
- android ImageView实现圆角(xml实现方法)
- 安卓自定义上面圆角下面直角的RoundCornerImageView
- 设置Button按钮上面圆角下面直角
- Android实现button一边圆角一边直角
- Android实现button一边圆角一边直角
- 实现上面两个角和下面两个角不同的xml drawable
- Android实现圆角ImageView
- android 实现圆角imageView的两种方法
- Imageview上边圆角,下边直角
- [视图]上面带描边的圆角,底部不描边的直角 按键xml 去局部描边
- Android ImageView实现圆角,圆形图片
- Android BitmapShader实现圆角、圆形ImageView
- 教你打造广告位的循环播放
- BZOJ3668 NOI2014 起床困难综合症 题解&代码
- CDOJ 1091 秋实大哥の恋爱物语 KMP
- BZOJ_P3450&Tyvj_P1952 Easy(概率期望动态规划)
- centos6.5有线网卡编译安装
- android ImageView实现上面圆角下面直角(xml实现方法)
- 2016太原UI设计师讲通道的原理,修图必学
- Tribon Data Base superserver and subserver
- Linux系统下添加Sudoer
- C++中的指针和动态分配二维数组问题
- 类与继承总结
- Gas Station
- TCP/IP 体系结构
- leetcode之 Minimum Height Trees