Android 用 xml View shape画线
来源:互联网 发布:免费地图标注软件 编辑:程序博客网 时间:2024/06/05 16:21
用 xml 产生一个 分割线
因为没有美工, 所以 只能 自己动手了
在 layout 文件夹 里的 xml 写
方法1: 在 layout 里面的布局 xml 文件里加上面的代码
<View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/orange_normal" />
效果图
在drawable文件夹里用 shape line 或 rectangle 先画线
方法2 在drawable 里面用 shape 新建一个 xml
然后在 layout 里的布局文件里引用
这种方法 可以 多处引用同一个 line 样式
<!-- drawable/line_my.xml --><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line" > <stroke android:color="@color/orange_normal" /></shape>
或者用填充的矩形实现
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="@color/orange_normal" /> <size android:height="1dp" android:width="100dp" /></shape>
Note
android:width=”100dp” 不能赋值为 “match_parent”
在layout/bomb_fragment.xml 里面引用
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/line_my" />
0 0
- Android 用 xml View shape画线
- Android UI---用xml自定义形状shape
- Android Shape XML文件
- Android XML绘图-Shape
- android开发之使用shape来画线,有一些注意点
- android开发之使用shape来画线,有一些注意点
- 利用android中的View来画线
- android 连线题实现 自定义view 画线
- Android自定义View(一) 画线段
- 自定义shape的view,不用配置xml
- android 用shape绘制虚线添加到view当背景
- android View使用shape作为背景不能指定单边圆角的xml
- Android XML Shape使用入门
- Android xml 深入解析shape
- android xml set,selector,shape
- android shape.xml 属性详解
- android shape.xml 文件使用
- android xml 绘图 shape 解析
- (3)创建一个查找对话框
- A007-assets资源
- 谷歌三大核心技术(一)Google File System中文版
- I学霸官方免费教程四十三 :Java流之字符流 Reader和Writer
- Legal or Not
- Android 用 xml View shape画线
- I学霸官方免费教程四十四 :Java流之字文件File类
- FT:android悬浮窗口的实现
- elasticsearch手动控制分片分布
- vi使用方法
- c# Hmac-md5
- 修改 EditText 中的光标显示的位置
- Android5.0 Framework - Activity启动过程(二)
- Android 开发常用的5种数据传递方法