Chinaunix首页 | 论坛 | 博客
  • 博客访问: 175371
  • 博文数量: 38
  • 博客积分: 638
  • 博客等级: 下士
  • 技术积分: 395
  • 用 户 组: 普通用户
  • 注册时间: 2011-10-07 17:16
文章分类

全部博文(38)

文章存档

2013年(1)

2012年(5)

2011年(32)

分类: 嵌入式

2011-12-16 10:34:48

常用的weight:
1 TextView
2 Button
3 CheckBox
4 RadioButton
5 CheckedTextView
6 Spinner
7 ProgressBar
8 SeekBar
9 RadioGroup
10 LinearLayout
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android=""
  3.     android:layout_width="fill_parent"
  4.     android:layout_height="fill_parent"
  5.     android:orientation="vertical" >

  6.     <TextView
  7.         android:id="@+id/textView1"
  8.         android:layout_width="wrap_content"
  9.         android:layout_height="wrap_content"
  10.         android:text="TextView" />

  11.     <Button
  12.         android:id="@+id/button1"
  13.         android:layout_width="wrap_content"
  14.         android:layout_height="wrap_content"
  15.         android:text="Button" />

  16.     <CheckBox
  17.         android:id="@+id/checkBox1"
  18.         android:layout_width="wrap_content"
  19.         android:layout_height="wrap_content"
  20.         android:text="CheckBox" />

  21.     <RadioButton
  22.         android:id="@+id/radioButton1"
  23.         android:layout_width="wrap_content"
  24.         android:layout_height="wrap_content"
  25.         android:text="RadioButton" />

  26.     <CheckedTextView
  27.         android:id="@+id/checkedTextView1"
  28.         android:layout_width="match_parent"
  29.         android:layout_height="wrap_content"
  30.         android:text="CheckedTextView" />

  31.     <Spinner
  32.         android:id="@+id/spinner1"
  33.         android:layout_width="match_parent"
  34.         android:layout_height="wrap_content" />

  35.     <ProgressBar
  36.         android:id="@+id/progressBar1"
  37.         style="?android:attr/progressBarStyleLarge"
  38.         android:layout_width="wrap_content"
  39.         android:layout_height="wrap_content" />

  40.     <ProgressBar
  41.         android:id="@+id/progressBar2"
  42.         android:layout_width="wrap_content"
  43.         android:layout_height="wrap_content" />

  44.     <ProgressBar
  45.         android:id="@+id/progressBar3"
  46.         style="?android:attr/progressBarStyleSmall"
  47.         android:layout_width="wrap_content"
  48.         android:layout_height="wrap_content" />

  49.     <ProgressBar
  50.         android:id="@+id/progressBar4"
  51.         style="?android:attr/progressBarStyleHorizontal"
  52.         android:layout_width="wrap_content"
  53.         android:layout_height="wrap_content" />

  54.     <SeekBar
  55.         android:id="@+id/seekBar1"
  56.         android:layout_width="match_parent"
  57.         android:layout_height="wrap_content" />

  58.     <RadioGroup
  59.         android:id="@+id/radioGroup1"
  60.         android:layout_width="wrap_content"
  61.         android:layout_height="wrap_content" >

  62.         <RadioButton
  63.             android:id="@+id/radio0"
  64.             android:layout_width="wrap_content"
  65.             android:layout_height="wrap_content"
  66.             android:checked="true"
  67.             android:text="RadioButton" />

  68.         <RadioButton
  69.             android:id="@+id/radio1"
  70.             android:layout_width="wrap_content"
  71.             android:layout_height="wrap_content"
  72.             android:text="RadioButton" />

  73.         <RadioButton
  74.             android:id="@+id/radio2"
  75.             android:layout_width="wrap_content"
  76.             android:layout_height="wrap_content"
  77.             android:text="RadioButton" />
  78.     </RadioGroup>

  79. </LinearLayout>
11 GirdLayout
12 RelativeLayout
13 FrameLayout
14 TableLayout

阅读(1332) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~