zoukankan      html  css  js  c++  java
  • ANDROID_MARS学习笔记_S01_009Relative_LAYOUT例子

    1.

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     android:layout_width="match_parent"
     4     android:layout_height="match_parent"
     5     android:paddingLeft="16dp"
     6     android:paddingRight="16dp" >
     7     <EditText
     8         android:id="@+id/name"
     9         android:layout_width="match_parent"
    10         android:layout_height="wrap_content"
    11         android:hint="@string/reminder" />
    12     <Spinner
    13         android:id="@+id/dates"
    14         android:layout_width="0dp"
    15         android:layout_height="wrap_content"
    16         android:layout_below="@id/name"
    17         android:layout_alignParentLeft="true"
    18         android:layout_toLeftOf="@+id/times" />
    19     <Spinner
    20         android:id="@id/times"
    21         android:layout_width="96dp"
    22         android:layout_height="wrap_content"
    23         android:layout_below="@id/name"
    24         android:layout_alignParentRight="true" />
    25     <Button
    26         android:layout_width="96dp"
    27         android:layout_height="wrap_content"
    28         android:layout_below="@id/times"
    29         android:layout_alignParentRight="true"
    30         android:text="@string/done" />
    31 </RelativeLayout>

    2.

     1 <RelativeLayout 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     android:paddingBottom="@dimen/activity_vertical_margin"
     6     android:paddingLeft="@dimen/activity_horizontal_margin"
     7     android:paddingRight="@dimen/activity_horizontal_margin"
     8     android:paddingTop="@dimen/activity_vertical_margin"
     9     tools:context="com.example.s01_e15_realtivelayout01.MainActivity" >
    10 
    11     <TextView
    12         android:id="@+id/first"
    13         android:layout_width="wrap_content"
    14         android:layout_height="wrap_content"
    15         android:background="#ff0000"
    16         android:text="用户登录" 
    17         android:layout_centerHorizontal="true"/>
    18     
    19     <EditText 
    20         android:id="@+id/username"
    21         android:layout_width="wrap_content"
    22         android:layout_height="wrap_content"
    23         android:layout_alignParentLeft="true"
    24         android:layout_alignParentRight="true"
    25         android:hint="username"
    26         android:layout_below="@id/first"/>
    27     <EditText 
    28         android:id="@+id/password"
    29         android:layout_width="match_parent"
    30         android:layout_height="wrap_content"
    31         android:hint="password"
    32         android:inputType="textPassword"
    33         android:layout_below="@id/username"/>
    34      <Button 
    35         android:layout_width="wrap_content"
    36         android:layout_height="wrap_content"
    37         android:text="登录"
    38         android:layout_below="@id/password"
    39         android:layout_toLeftOf="@+id/cancel"/>
    40     <Button
    41         android:id="@id/cancel"
    42         android:layout_width="wrap_content"
    43         android:layout_height="wrap_content"
    44         android:text="取消"
    45         android:layout_below="@id/password"
    46         android:layout_alignParentRight="true"/>
    47  
    48 
    49 
    50 </RelativeLayout>
  • 相关阅读:
    【简】题解 AWSL090429 【市场】
    【简】题解 AWSL090429 【噪音】
    差分约束
    凸包模板
    杂模板
    后缀数组刷题
    Trie刷题
    字符串模板
    网络流建模专题
    组合数模板
  • 原文地址:https://www.cnblogs.com/shamgod/p/5186534.html
Copyright © 2011-2022 走看看