First class: UI design for Android

来源:互联网 发布:时时彩倍投软件 编辑:程序博客网 时间:2024/05/05 10:25

<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"     tools:context=".MainActivity">    <TextView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="Tom"        android:layout_centerHorizontal="true"        android:id="@+id/name"        android:textSize="30dp"        />    <TextView        android:layout_below="@+id/name"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="by"        android:layout_centerHorizontal="true"        android:id="@+id/by"        android:textSize="30dp"        />    <LinearLayout        android:layout_below="@+id/by"        android:layout_width="match_parent"        android:orientation="horizontal"        android:layout_height="match_parent">        <TextView            android:layout_width="0dp"            android:layout_height="wrap_content"            android:layout_weight="1"            android:background="#ff9bff37"            android:text="Tom"            android:textSize="40dp"         />        <TextView            android:layout_width="0dp"            android:layout_height="wrap_content"            android:layout_weight="1"            android:background="#FF0000"            android:text="Smith"            android:textSize="40dp"            />    </LinearLayout></RelativeLayout>






0 0
原创粉丝点击