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>
  • 相关阅读:
    【洛谷 P4542】 [ZJOI2011]营救皮卡丘(费用流)
    【洛谷 P2604】 [ZJOI2010]网络扩容(最大流,费用流)
    【洛谷 P3191】 [HNOI2007]紧急疏散EVACUATE(二分答案,最大流)
    【CF802C】 Heidi and Library (hard)(费用流)
    【洛谷 P4134】 [BJOI2012]连连看(费用流)
    【洛谷 P3965】 [TJOI2013]循环格(费用流)
    【洛谷 P3227】 [HNOI2013]切糕(最小割)
    【洛谷 P4072】 [SDOI2016]征途(斜率优化)
    【洛谷 P4437】 [HNOI/AHOI2018]排列(贪心,堆)
    【洛谷 P4291】 [HAOI2008]排名系统(Splay,Trie)
  • 原文地址:https://www.cnblogs.com/shamgod/p/5186534.html
Copyright © 2011-2022 走看看