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>

  • 相关阅读:
    thinkPHP中怎么访问域名直接跳到后台登录页面
    使用ajax方法实现form表单的提交
    微信小程序根据生日获取年龄
    微信小程序出现 text 设置行高 line-height 无效的问题
    微信小程序中换行,空格(多个空格)写法
    如何用css实现弧度圆角?三角形以及圆形
    微信小程序的bindtap事件
    JS控制只能输入数字并且最多允许小数点两位
    微信小程序如何做金额输入限制
    微信小程序使用函数的三种方法
  • 原文地址:https://www.cnblogs.com/goldeneast/p/3167220.html
Copyright © 2011-2022 走看看