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>
  • 相关阅读:
    聊下 git 使用前的一些注意事项
    .NET架构设计、框架设计系列文章总结
    聊下 git remote prune origin
    聊下git pull --rebase
    聊下git merge --squash
    git 命令使用总结
    聊下 git rebase -i
    ElasticSearch大数据分布式弹性搜索引擎使用
    DDD实施经验分享—价值导向、从上往下进行(圈内第一个吃螃蟹DDD实施方案)
    SaaS产品项目实施流程
  • 原文地址:https://www.cnblogs.com/shamgod/p/5186534.html
Copyright © 2011-2022 走看看