摘要:
先看效果图: XML代码: 1 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 tools:context=".GridViewDemoBA" 阅读全文
posted @ 2013-01-08 16:16
merryjd
阅读(1540)
评论(0)
推荐(0)
摘要:
LinearLayout linearLayout = new LinearLayout(context); //设定线性布局的方向为竖直方向 linearLayout.setOrientation(LinearLayout.VERTICAL); //设定线性布局的填充方式为自适应 linearLayout.setLayoutParams(new LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); //设定线... 阅读全文
posted @ 2013-01-08 14:38
merryjd
阅读(319)
评论(0)
推荐(0)
摘要:
一.作用: LayoutInflater作用是将layout的xml布局文件实例化为View类对象,LayoutInflater的作用类似于 findViewById(),不同点是LayoutInflater是用来找layout文件夹下的xml布局文件,并且实例化!而 findViewById()是找具体某一个xml下的具体 widget控件(如:Button,TextView等)。 二.获得 LayoutInflater 实例的三种方式 1.LayoutInflaterinflater=getLayoutInflater(); //调用Activity的getLay... 阅读全文
posted @ 2013-01-08 14:35
merryjd
阅读(5344)
评论(0)
推荐(0)
浙公网安备 33010602011771号