zoukankan      html  css  js  c++  java
  • android 各种布局技术

    RelativeLayout:

    “<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android
                    android:layout_width="
    fill_parent"
                    android:layout_height="
    wrap_content"
                    android:background="
    @drawable/blue"
                    android:padding="
    10px" >

       
    <TextViewandroid:id="@+id/label"
                 
    android:layout_width="fill_parent"
                 
    android:layout_height="wrap_content"
                 
    android:text="Type here:"/>

       
    <EditTextandroid:id="@+id/entry"
                 
    android:layout_width="fill_parent"
                 
    android:layout_height="wrap_content"
                 
    android:background="@android:drawable/editbox_background"
                 
    android:layout_below="@id/label"/>
     
       
    <Buttonandroid:id="@+id/ok"
               
    android:layout_width="wrap_content"
               
    android:layout_height="wrap_content"
               
    android:layout_below="@id/entry"
               
    android:layout_alignParentRight="true"
               
    android:layout_marginLeft="10px"
               
    android:text="OK"/>

       
    <Buttonandroid:layout_width="wrap_content"
               
    android:layout_height="wrap_content"
               
    android:layout_toLeftOf="@id/ok"
               
    android:layout_alignTop="@id/ok"
               
    android:text="Cancel"/>
    </RelativeLayout>

    2.tableLayout

    “<?xml version="1.0" encoding="utf-8"?>
    <TableLayoutxmlns:android="http://schemas.android.com/apk/res/android"
       
    android:layout_width="fill_parent"
       
    android:layout_height="fill_parent"
       
    android:stretchColumns="1">
       
    <TableRow>
           
    <TextView
               
    android:text="@string/table_layout_4_open"
               
    android:padding="3dip"/>
           
    <TextView
               
    android:text="@string/table_layout_4_open_shortcut"
               
    android:gravity="right"
               
    android:padding="3dip"/>
       
    </TableRow>

       
    <TableRow>
           
    <TextView
               
    android:text="@string/table_layout_4_save"
               
    android:padding="3dip"/>
           
    <TextView
               
    android:text="@string/table_layout_4_save_shortcut"
               
    android:gravity="right"
               
    android:padding="3dip"/>
       
    </TableRow>
    </TableLayout>

    3.FrameLayout

    框架布局

    “<?xml version="1.0" encoding="utf-8"?>

    <TableLayoutxmlns:android="http://schemas.android.com/apk/res/android"

       
    android:layout_width="fill_parent"

       
    android:layout_height="fill_parent"

       
    android:stretchColumns="1">

    <ImageView

     android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:src="@drawable/movie"

    />

    <ImageView

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:src="@drawable/play"

    android:layout_gravity="center"

    />

    </FrameLayout>

  • 相关阅读:
    图灵测试
    百度面试题
    【javascript每日一练】- 插入排序
    各种排序讲解
    【javascript每日一练】- 多维数组
    不用JQuery,原生Javascript实现Ajax功能及相关知识点
    【javascript每日一练】- 无序数组排序
    前端面试题
    前端重构面试题
    面试题
  • 原文地址:https://www.cnblogs.com/goldeneast/p/3167220.html
Copyright © 2011-2022 走看看