摘要: LayoutInflater作用是将layout的xml布局文件实例化为View类对象。获取LayoutInflater的方法有如下三种:LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);View layout = inflater.inflate(R.layout.main,null);LayoutInflater inflater = LayoutInflater.from(context); (该方法实质就是第一种方法,可参考源代码)View 阅读全文
posted @ 2012-11-22 17:22 黄泉hj 阅读(227) 评论(0) 推荐(0) 编辑
摘要: android:layout_above将该控件的底部至于给定ID的控件之上,但不会左对齐,默认置于父窗口最左边,会覆盖最左边的控件android:layout_below将该控件的顶部至于给定ID的控件之下,但不会左对齐,默认置于父窗口最左边,会覆盖最左边的控件android:layout_toLeftOf将该控件的右边缘和给定ID的控件的左边缘对齐,默认置于父窗口最上面,会覆盖最上面的控件android:layout_toRightOf将该控件的左边缘和给定ID的控件的右边缘对齐,默认置于父窗口最上面,会覆盖最上面的控件android:alignParentBottom如果该值为true, 阅读全文
posted @ 2012-11-22 16:54 黄泉hj 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 可以用LinearLayout来包住EditText,如下: 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:orientation="vertical" 4 android:layout_width="fill_parent" 5 android:layout_height= 阅读全文
posted @ 2012-11-22 13:57 黄泉hj 阅读(259) 评论(0) 推荐(0) 编辑
沪江在线词典