摘要: 引用:http://www.devdiv.com/thread-73074-1-1.htmlLinearLayout.LayoutParams para=new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT ); para.setMargins(20, 20, 20, 20); //left,top,right, bottom para.gravity = Gravity.RIGHT; tv.setLayoutParams(para); tv.setBackgroundResourc 阅读全文
posted @ 2011-08-10 22:12 镇水古月 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 引用:http://blog.sina.com.cn/s/blog_68580ed90100t3q7.htmlLinearLayout: android:id 为控件指定相应的ID android:text 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符 android:grivity 指定控件的基本位置,比如说居中,居右等位置 android:textSize 指定控件当中字体的大小 android:background 指定该控件所使用的背景色,RGB命名法 android:width 指定控件的宽度 android:height 指定控件的高度 a 阅读全文
posted @ 2011-08-10 21:54 镇水古月 阅读(367) 评论(0) 推荐(0) 编辑
摘要: <?xml version="1.0" encoding="UTF-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/sub_item_item_bg"android:orientat 阅读全文
posted @ 2011-08-10 20:34 镇水古月 阅读(405) 评论(0) 推荐(0) 编辑
摘要: BitmapDrawable drawable = new BitmapDrawable(bitmap); layout.setBackgroundDrawable(drawable); 阅读全文
posted @ 2011-08-10 16:16 镇水古月 阅读(233) 评论(0) 推荐(0) 编辑
摘要: android view的setVisibility方法值的意思有三个值 visibility One of VISIBLE, INVISIBLE, or GONE.常量值为0,意思是可见的常量值为4,意思是不可见的常量值为8,意思是不可见的,而且不占用布局空间例:curView.setVisibility(4); 阅读全文
posted @ 2011-08-10 15:53 镇水古月 阅读(284) 评论(0) 推荐(0) 编辑
摘要: View convertView = listContainer.inflate(R.layout.submenu_item, null); //获取list_item布局文件的视图 TableLayout blocksLayout = (TableLayout)convertView.findViewById(R.id.submenu_layout); //布局文件中找到表格布局 阅读全文
posted @ 2011-08-10 15:39 镇水古月 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 引用:http://www.linuxidc.com/Linux/2011-05/35950.htm 我们可以通过使用类DisplayMetrics来获取手机屏幕的分辨率大小。DisplayMetrics类是获取手机屏幕各种属性的关键类。下面通过例子来展示如何获取手机屏幕的分辨率。 在布局文件main.xml中添加一个TextView对象,一个Button对象。其中TextView对象用来显示获得的分辨率值,Button对象是当点击时获取分辨率。main.xml的代码如下:<?xmlversion="1.0"encoding="utf-8"?> 阅读全文
posted @ 2011-08-10 13:36 镇水古月 阅读(292) 评论(0) 推荐(0) 编辑
摘要: int initPicture = R.drawable.beauty1 ;Bitmap sourcePicture;//图片来源sourcePicture = BitmapFactory.decodeResource(gameActivity.getResources(), initPicture); //得到图片imgView.setImageBitmap(Bitmap.createBitmap(sourcePicture,j * blockWidth, i * blockHeight, blockWidth, blockHeight)); 阅读全文
posted @ 2011-08-10 11:37 镇水古月 阅读(300) 评论(0) 推荐(0) 编辑
摘要: 字体源文:http://www.homefont.cn/html/shiliangziti/zitiTTP/ 阅读全文
posted @ 2011-08-10 09:40 镇水古月 阅读(242) 评论(0) 推荐(0) 编辑