如何给TableLayout加边框
呵呵,其实很简单
就是将TableLayout定义一种颜色,在给TableRow定义一种颜色。通过TableRow的layout_margin挤出一个像素的宽度就变成了TableLayout的宽度。这种方法好不好,我也不知道,就是自己经常用,如果有更好的方案,希望提供。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"> <TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#939093" > <ImageButton
android:id="@+id/weather_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/t5" /> <ImageButton
android:id="@+id/contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/jsq2" /> <ImageButton
android:id="@+id/notepad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/js6" />
</TableRow> <TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#939093" > <ImageButton
android:id="@+id/calculator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/j5" /> <ImageButton
android:id="@+id/ems_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/k3" /> <ImageButton
android:id="@+id/calendar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0.5dip"
android:layout_marginRight="0.5dip"
android:background="@drawable/index_btn"
android:src="@drawable/r2" />
</TableRow> </TableLayout>
如何给TableLayout加边框的更多相关文章
- Html-浅谈如何正确给table加边框
一般来说,给表格加边框都会出现不同的问题,以下是给表格加边框后展现比较好的方式 <style> table,table tr th, table tr td { border:1px so ...
- 多行图片hover加边框兼容IE7+
问题: 遇到多行多列排列的图片时,hover上去加边框会把下面的图片挤到别处 ============================================================ ...
- div加边框
一.虚线与实线边框 边框虚线样式:dashed 边框实现样式:solid border:1px dashed #000 代表设置对象边框宽度为1px黑色虚线边框 border:1px solid #0 ...
- CSS鼠标悬停图片加边框效果,不位移的方法
<!DOCTYPE HTML> <html lang="en-US"> <head> <title>css实现鼠标悬停时图片加边框效 ...
- AS3给显示对象加边框
给显示对象加边框,可以有以下三种方法1.根据相交路径的缠绕规则的奇偶规则法(使用奇偶缠绕规则时,任何相交路径都交替使用开放填充与闭合填充.如果使用同一填充绘制的两个正方形相交,则不会填充相交的区域.通 ...
- DDGScreenShot--iOS 图片裁剪,切圆角,加边框,你还用cornerRadius,还有更高级的用法
写在前面 我们肯定做过这样的需求,给一个图片切圆角, 当然我们大多采用简单粗暴的方法 myIcon.layer.cornerRadius = 16.5 myIcon.layer.masksToBoun ...
- C#实现给图片加边框的方法
Bitmap bit= new Bitmap(@"" + Path);//给图片加边框 //Bitmap bit = new Bitmap(Screen.AllScreens[0] ...
- 浅谈如何正确给table加边框
一般来说,给表格加边框都会出现不同的问题,以下是给表格加边框后展现比较好的方式 <style> table,table tr th, table tr td { border:1px so ...
- 用CSS给表格加边框
很久之前,给表格加边框用的方法是给表格加上背景色,然后把cellspacing="1",再给td设置成另一种颜色,这样间接的加边框颜色. 一直没去细研究,今天发现了一种很简单的加边 ...
随机推荐
- jQuery表格排序总成-tablesorter
一个.进口单证 <script type="text/javascript" src="js/jquery.js"></script> ...
- UVa 11790 - Murcia's Skyline
称号:给你一个行长度的建设和高度,我们祈求最长的和下降的高度. 分析:dp,最大上升子. 说明:具有长度,不能直接优化队列单调. #include <iostream> #include ...
- 错误 4 自定义工具错误: 无法生成服务引用“DepartMentService”的代码。请检查其他错
原文:错误 4 自定义工具错误: 无法生成服务引用"DepartMentService"的代码.请检查其他错 问题: 错误 4 自定义工具错误: 无法生成服务引用" ...
- 《学习opencv》笔记——矩阵和图像处理——cvAnd、cvAndS、cvAvg and cvAvgSdv
矩阵和图像的操作 (1)cvAnd函数 其结构 void cvAnd( //将src1和src2按像素点取"位与运算" const CvArr* src1,//第一个矩阵 cons ...
- Cocos2d-x v3.0 正式版 如何创建一个项目,TestCpp执行
欢迎增加 Cocos2d-x 交流群: 193411763 转载请注明原文出处:http://blog.csdn.net/u012945598/article/details/24456579 首先到 ...
- oracle当需要commit
今天oracle的SQL plus 运行该删除和查询操作,然后PL/SQL还运行查询.相同的句子,结果是不一样的.我郁闷很大,然后,突然想到这可能对双方造成由数据不一致,为什么不一致呢.就是没用com ...
- SQL Server编程系列(2):SMO常用对象的有关操作
原文:SQL Server编程系列(2):SMO常用对象的有关操作 在上一篇周公简单讲述了SMO的一些基本概念,实际上SMO体系结构远不止周公在上一篇中讲述的那么简单,下图是MSDN上给出的一个完整的 ...
- Java日期的格式String类型GMT,GST换算成日期Date种类
请尊重他人的劳动成果.转载请注明出处:Java日期格式化之将String类型的GMT,GST日期转换成Date类型 http://blog.csdn.net/fengyuzhengfan/articl ...
- MyEclipse下一个XFire发展Webservice示例
最近的研究JAVA发展Webservice.网络发现几个热门选择AXIS.XFire.CFX(XFire下一代),打开前几天对这篇文章比较三种选择,他们已经有了一些概念. 样本,以确定自己的实践 在開 ...
- jQuery中queue和dequeue的用法
jQuery中的queue和dequeue是一组很有用的方法,他们对于一系列需要按次序运行的函数特别有用.特别animate动画,ajax,以及timeout等需要一定时间的函数 queue和dequ ...