如何给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设置成另一种颜色,这样间接的加边框颜色. 一直没去细研究,今天发现了一种很简单的加边 ...
随机推荐
- 关于java socket(转)
1. 关于new Socket()中参数的理解 Server端: 调用ServerSocket serverSocket = new ServerSocket(1287,2);后Server端打开了指 ...
- ZOJ-3652-Maze(BFS)
Celica is a brave person and believer of a God in the bright side. He always fights against the mons ...
- 用Markdown来写作
Markdown 是一种简单的.轻量级的标记语法.github上面很多的README就是用markdonw语法写的. Markdown 的语法十分简单,常用的标记符号也不超过十个,且一旦熟悉这种语法规 ...
- I2C驱动程序框架probe道路
基于Linux的I2C驱动器.采纳probe道路.根据这个框架,如下面就可以写任何支持I2C总线设备Linux驱动器. I2C设备连接到cpu具体i2c接口.被安装在cpu的i2c适配器.i2c设备和 ...
- 注册 集 与 删除 -- C
文章3位设置和清除操作. #include <stdio.h> #include <stdlib.h> #include <string.h> #define BI ...
- 解决:<net.sf.ehcache.util.UpdateChecker> : New update(s) found: 2.6.5
由于该项目采用ehcache,所以tomcat每次登录你开始打印net.sf.ehcache.util.UpdateChecker doCheck 一旦有没有特别关注.从今天开始 Tomcat 什么时 ...
- Java有用的经验--Swing片
Java有用经验总结--Swing篇 前言 本文前言部分为我的一些感想,假设你仅仅对本文介绍的Java有用技巧感兴趣,能够跳过前言直接看正文的内容. 本文的写作动机来源于近期接给人家帮忙写的一个小程序 ...
- Jquery zTree实例
zTree[简单介绍] zTree 是利用 JQuery 的核心代码,实现一套能完毕大部分经常使用功能的 Tree 插件 兼容 IE.FireFox.Chrome 等浏览器 在一个页面内可同一时候生成 ...
- ResultSet 转为 List或者JavaBean
一.将ResultSet结果集转换为List,其中每条记录信息保存为Map放到List中,方法如下: public static List<Map<String, Object>&g ...
- C#中WebBrowser的使用
原文:C#中WebBrowser的使用 其实网络上这类文章很多,我大致从头说说我自己的经验. 1.加入引用 在控件栏按右键,选择“添加/移除项”,选COM组件,选中“Microsoft Web Bro ...