温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Android 相对布局 简单编程

发布时间:2020-07-29 11:24:07 来源:网络 阅读:347 作者:郑传余 栏目:移动开发
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"       xmlns:tools="http://schemas.android.com/tools"       android:layout_width="match_parent"       android:layout_height="match_parent">          <TextView            android:id="@+id/tv_name"           android:layout_marginLeft="20dp"           android:layout_marginTop="40dp"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:text="姓名:"           />       <EditText           android:id="@+id/ed_name"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:layout_alignBaseline="@+id/tv_name"           android:layout_alignBottom="@+id/tv_name"           android:layout_toRightOf="@+id/tv_name"           android:ems="10"           android:hint="请输入您的姓名" >           <requestFocus />       </EditText>              <TextView            android:id="@+id/tv_sex"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:layout_below="@id/ed_name"           android:layout_alignLeft="@id/tv_name"           android:layout_marginTop="30dp"           android:text="性别:"           />          <EditText           android:id="@+id/ed_sex"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:layout_alignBaseline="@+id/tv_sex"           android:layout_alignBottom="@+id/tv_sex"           android:layout_alignLeft="@+id/ed_name"           android:ems="10"           android:hint="请输入您的性别" />              <TextView            android:id="@+id/tv_motto"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:layout_below="@id/tv_sex"           android:layout_alignLeft="@id/tv_sex"           android:layout_marginTop="30dp"           android:text="座右铭:"           />          <EditText           android:id="@+id/ed_motto"           android:layout_width="wrap_content"           android:layout_height="wrap_content"           android:layout_alignBaseline="@+id/tv_motto"           android:layout_alignBottom="@+id/tv_motto"           android:layout_alignLeft="@+id/ed_sex"           android:ems="10"           android:hint="请输入您的座右铭" />              <LinearLayout            android:id="@+id/linear"           android:layout_width="match_parent"           android:layout_height="wrap_content"           android:orientation="horizontal"           android:layout_below="@id/tv_motto"           android:layout_marginTop="30dp"           >           <Button                android:id="@+id/btn_determine"               android:layout_width="0dp"               android:layout_weight="1"               android:layout_height="wrap_content"               android:text="确定"               />              <Button                android:id="@+id/btn_cancel"               android:layout_width="0dp"               android:layout_weight="1"               android:layout_height="wrap_content"               android:text="取消"               />       </LinearLayout>              <TextView            android:id="@+id/tv_show"           android:layout_width="match_parent"           android:layout_height="wrap_content"           android:layout_below="@id/linear"           android:layout_marginTop="30dp"           />   </RelativeLayout>   详细讲解:http://v.youku.com/v_show/id_XNzMwNzc4OTE2.html


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI