您的位置:首页 > 理论基础

计算机界面

2016-04-19 23:01 363 查看
1、RelativeLayout

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"

>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:width="400dp"
android:height="150dp"
android:background="#ccc"
android:layout_gravity="center"/>
</FrameLayout>

<TableRow
android:layout_weight="1">

<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="C"
android:textSize="25dp"
android:id="@+id/button"
/>

<Button
android:layout_width="0dp"
android:textSize="25dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="DEL"
android:id="@+id/button2" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="÷"
android:id="@+id/button3" />
<Button
android:layout_width="0dp"
android:textSize="25dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="X"
android:id="@+id/button4" />
</TableRow>
<TableRow
android:layout_weight="1">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="7"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="8"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="9"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="-"/>
</TableRow>
<TableRow
android:layout_weight="1">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="4"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="5"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="6"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="+"/>
</TableRow>
<TableRow
android:layout_weight="1">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="1"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="2"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="3"/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="( )"/>
</TableRow>
<TableRow
android:layout_weight="1">
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:textSize="25dp"
android:text="0" />
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="."/>
<Button
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:textSize="25dp"
android:text="="/>
</TableRow>

</TableLayout>


View Code

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: