android 学习 之 布局(下)LinearLayout,RelativeLayout,TableLayout,FrameLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:background="#FFFFCC"    android:orientation="vertical"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context="com.rhythmk.app.MainActivity$PlaceholderFragment" >    <!--           wap_content :包裹实际文本宽度, match_parent: 铺满父类容器, fill_parent:铺满父类容器    -->    <Button        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:text="按钮1" />    <Button        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:text="按钮2" />    <Button        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:text="按钮3" />    <LinearLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="#CCCC66"        android:orientation="horizontal" >        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="按钮01" />        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="按钮02" />        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="按钮03" />    </LinearLayout>    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="#99CC66"        android:orientation="horizontal" >        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="按钮11" />        <Button            android:id="@+id/btn12"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_marginLeft="150sp"            android:layout_marginTop="50sp"            android:text="按钮12" />        <Button            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_marginLeft="60sp"            android:layout_marginTop="50sp"            android:layout_toRightOf="@+id/btn12"            android:text="按钮13" />    </RelativeLayout>    <TableLayout        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="#9933CC"        android:shrinkColumns="1"        android:stretchColumns="0,1,2" >        <Button            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:text="独立行" />        <TableRow            android:layout_width="match_parent"            android:layout_height="wrap_content" >            <Button                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:text="按钮21" />            <Button                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:text="按钮22" />            <Button                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:text="按钮22" />        </TableRow>        <TableRow            android:layout_width="match_parent"            android:layout_height="wrap_content" >            <Button                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:text="按钮31" />            <Button                android:layout_width="match_parent"                android:layout_height="wrap_content"                android:layout_column="2"                android:text="我可以自动延生" />        </TableRow>    </TableLayout>    <FrameLayout        android:layout_width="match_parent"        android:layout_height="match_parent"        android:background="#0033CC"        android:padding="20px" >        <Button            android:layout_width="250px"            android:layout_height="150px"            android:background="#330033"            android:text="FrameLayout001" />        <Button            android:layout_width="250px"            android:layout_height="150px"            android:layout_marginLeft="100sp"            android:layout_marginTop="80sp"            android:background="#990066"            android:text="FrameLayout002" />    </FrameLayout></LinearLayout>

更多相关文章

  1. Android 动态切换底部tab按钮
  2. Android 的 Button 按钮实现的两种方式
  3. ImageButton动态改变按钮图片
  4. android 按钮按下效果(文字颜色和按钮同时变化)
  5. EditText在输入法上显示搜索按钮
  6. android设置按钮背景透明度与设置布局背景图片的透明度
  7. android ListView中添加ImageButton按钮并绑定事件
  8. Android学习笔记4之容器

随机推荐

  1. Android之DiskLruCache(缓存工具)
  2. Android客户端向服务器端传值——登录实
  3. android开发随记 - Google Map
  4. windows下Qt5.1 for android开发环境配置
  5. 使用PC端chrome 浏览器远程连接android设
  6. 谁调用了activity的oncreate()方法
  7. [转]Android SDK升级时的错误及解决方法
  8. 告别Dagger2模板代码:DaggerAndroid使用详
  9. Android display架构分析(二)
  10. Android Studio导入Eclipse项目