Android开发(三)——Android布局中实现圆角边框
设置corners_bg.xml(设置边框圆角可以在drawable-mdpi目录里定义一个xml):
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<corners android:topLeftRadius="10dp"
android:topRightRadius="10dp"
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"/>
</shape>
引用corners_bg.xml:
android:background="@drawable/corners_bg"
应用范例:
<?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="#E1E0DE"
android:orientation="vertical" > <TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#2B3439"
android:gravity="center"
android:text="发现"
android:textColor="#FFFFFF"
android:textSize="20sp" /> <LinearLayout
android:id="@+id/login_div"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_margin="10dp"
android:background="@drawable/corners_bg"
android:gravity="center_vertical"
android:padding="10dp" > <ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/find_more_friend_photograph_icon" /> <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="朋友圈"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="101dp"
android:layout_margin="10dp"
android:background="@drawable/corners_bg"
android:orientation="vertical"
android:padding="10dp" > <LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp" > <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/find_more_friend_scan" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="扫一扫"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true" > <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/come_from_shake" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="摇一摇"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout> <LinearLayout
android:layout_width="fill_parent"
android:layout_height="101dp"
android:layout_margin="10dp"
android:background="@drawable/corners_bg"
android:orientation="vertical"
android:padding="10dp" > <LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp" > <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/find_more_friend_near_icon" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="附近的人"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_centerVertical="true" > <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/come_from_bottle" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="漂流瓶"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout> <LinearLayout
android:id="@+id/login_div"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_margin="10dp"
android:background="@drawable/corners_bg"
android:gravity="center_vertical"
android:padding="10dp" > <ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/more_game" /> <TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:text="游戏中心"
android:textColor="#000"
android:textSize="18sp" />
</LinearLayout> </LinearLayout>
转自:http://www.open-open.com/lib/view/open1379941411367.html
Android开发(三)——Android布局中实现圆角边框的更多相关文章
- Android布局中实现圆角边框
设置corners_bg.xml 设置边框圆角可以在drawable-mdpi目录里定义一个xml: <?xml version="1.0" encoding="u ...
- 【Android】Android布局中实现圆角边框
设置corners_bg.xml 设置边框圆角可以在drawable-mdpi目录里定义一个xml: <?xml version="1.0" encoding="u ...
- Android开发:在Eclipse中配置Android环境
一.文件需要: https://pan.baidu.com/s/1-XCSSPW5JGyPRlvwRVSfmA 提取码:m5t8 NDK过大没有上传在这个文件里. 二.在Eclipse中配置Tools ...
- CSharp程序员学Android开发---3.Android内部元素不填充BUG
最近公司组织项目组成员开发一个Android项目的Demo,之前没有人有Andoid方面的开发经验,都是开发C#的. 虽说项目要求并不是很高,但是对于没有这方面经验的人来说,第一步是最困难的. 项目历 ...
- AllJoyn+Android开发案例-android跨设备调用方法
AllJoyn+Android开发案例-android跨设备调用方法 项目须要涉及AllJoyn开源物联网框架.前面主要了解了一些AllJoyn主要的概念.像总线,总线附件,总线对象,总线接口这种概念 ...
- Android开发-之五大布局
在html中大家都知道布局是什么意思了,简单来说就是将页面划分模块,比如html中的div.table等.那么Android中也是这样的.Android五大布局让界面更加美化,开发起来也更加方便.当然 ...
- android开发学习---layout布局、显示单位和如何进行单元测试
一.五大布局(layout) android中的用五大布局:LinearLayout (线性布局).AbsoluteLayout(绝对布局).RelativeLayout(相对布局).TableLay ...
- Android仿微信UI布局视图(圆角布局的实现)
圆角button.或布局能够在xml文件里实现,但也能够使用图片直接达到所需的效果,曾经版本号的微信就使用了这样的方法. 实现效果图: watermark/2/text/aHR0cDovL2Js ...
- Android开发三种第三方图片加载的框架
最近在项目中用到了大量图片加载,第三方优秀框架还不错,下面介绍三款榜首的框架用法和问题,做一个记录. 现在项目使用的是Android Studio开发的,现在也没有多少人使用Eclipse了吧. 一. ...
随机推荐
- O'Reilly总裁提姆-奥莱理:什么是Web 2.0
O'Reilly总裁提姆-奥莱理:什么是Web 2.0 译者序:Web 2.0这一概念,由O'Reilly媒体公司总裁兼CEO提姆·奥莱理提出.他是美国IT业界公认的传奇式人物,是“开放源码”概念的缔 ...
- MySQL导入SQL文件过大或连接超时的解决办法/在navcat执行sql卡在0%
set global max_allowed_packet=100 000 000;set global net_buffer_length=100000;SET GLOBAL interactiv ...
- Jquery UI的日历控件datepicker限制日期(转)
网上找到这篇文章:http://www.jssay.com/blog/index.php/2010/04/27/%E5%A6%82%E4%BD%95%E7%A6%81%E7%94%A8datepick ...
- Hadoop学习:Map/Reduce初探与小Demo实现
原文地址:https://blog.csdn.net/liyong199012/article/details/25423221 一. 概念知识介绍 Hadoop MapReduce是一个用于处 ...
- SQL2000的系统表sysproperties在SQL2005中 无效的 问题
有两种解决办法 方法一.是我在网上找的:将原来的sysproperties改成sys.extended_properties并且对应关系如下 sys.extended_properties left ...
- 微信图片分享遇到 checkArgs fail, thumbData is invalid
该问题主要是微信图片限制32K以内的原因,可将bmpToByteArray方法进行进行改写. 原方法是: /** * 得到Bitmap的byte * @author netcorner * @para ...
- easyui刷新指定tab页里面的数据
主页Home/Index中使用tab管理,在主页中设置一个刷新的方法. /** * 刷新指定的tab里面的数据 * @param title 选项卡标题 * @param refreshTabFunc ...
- Ubuntu 13.04开机亮度调节
终于把我的T430换成Ubuntu,本来还打算等几天13.10,想想反正能升级,趁着101长假就抓紧换了吧~` 总体来说遇到的问题不是很多,可能是Thinkpad在Linux或者ubuntu的方面做的 ...
- 使用mysqldump导入导出MySQL数据库
数据库的基本导入\导出的命令 是 mysqldump 和 source 在linux下直接用命令行操作就可以 在windows下 一般情况下有两种方法一个也是用命令行 另一个是用phpmyadmin ...
- Python 爬虫实例(15) 爬取 汽车之家(汽车授权经销商)
有人给我吹牛逼,说汽车之家反爬很厉害,我不服气,所以就爬取了一下这个网址. 本片博客的目的是重点的分析定向爬虫的过程,希望读者能学会爬虫的分析流程. 一:爬虫的目标: 打开汽车之家的链接:https: ...