计算机界面

1、RelativeLayout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:id="@+id/linearLayout"
        android:weightSum="1">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:width="400dp"
            android:height="150dp"
            android:background="#ccc" />
    </LinearLayout>

    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:layout_below="@+id/linearLayout"
        android:id="@+id/button"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="2dp"
        android:text="C"
        android:textSize="25dp"/>

    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="DEL"
        android:id="@+id/button2"
        android:layout_below="@+id/linearLayout"
        android:layout_toRightOf="@+id/button"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="÷"
        android:id="@+id/button3"
        android:layout_below="@+id/linearLayout"
        android:layout_toRightOf="@+id/button2"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="X"
        android:id="@+id/button4"
        android:layout_below="@+id/linearLayout"
        android:layout_toRightOf="@+id/button3"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="7"
        android:id="@+id/button5"
        android:layout_below="@+id/button"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="8"
        android:id="@+id/button6"
        android:layout_below="@+id/button"
        android:layout_toRightOf="@id/button5"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:layout_below="@id/button"
        android:text="9"
        android:id="@+id/button7"
        android:layout_toRightOf="@id/button6"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="-"
        android:id="@+id/button8"
        android:layout_below="@id/button"
        android:layout_toRightOf="@id/button7"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
       android:text="4"
        android:id="@+id/button9"
       android:layout_below="@id/button5"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="5"
        android:layout_below="@id/button5"
        android:id="@+id/button10"
        android:layout_toRightOf="@id/button9"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="6"
        android:layout_below="@id/button5"
        android:id="@+id/button11"
        android:layout_toRightOf="@id/button10"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="+"
        android:layout_below="@id/button5"
        android:id="@+id/button12"
        android:layout_toRightOf="@id/button11"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="1"
        android:layout_below="@id/button9"
        android:id="@+id/button13"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="2"
        android:layout_below="@id/button9"
        android:id="@+id/button14"
        android:layout_toRightOf="@id/button13"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="3"
        android:layout_below="@id/button9"
        android:id="@+id/button15"
        android:layout_toRightOf="@id/button14"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="="
        android:layout_below="@id/button9"
        android:id="@+id/button16"
        android:layout_toRightOf="@id/button15"
        android:layout_alignBottom="@+id/button18"
        android:textSize="25dp"/>
    <Button
        android:layout_width="210dp"
        android:layout_height="72dp"
        android:text="0"
        android:id="@+id/button17"
        android:layout_below="@id/button13"
        android:layout_alignRight="@+id/button14"
        android:layout_alignEnd="@+id/button14"
        android:textSize="25dp"/>
    <Button
        android:layout_width="100dp"
        android:layout_height="72dp"
        android:text="."
        android:layout_below="@id/button13"
        android:layout_toRightOf="@id/button17"
        android:id="@+id/button18"
        android:textSize="25dp"/>
</RelativeLayout>

2、TableLayout

<?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>

时间: 2024-08-24 17:17:34

计算机界面的相关文章

事件监听与计算机界面

1.事件监听 package 事件监听;import java.awt.*;import java.awt.event.*; public  class Frame2 extends Frame implements ActionListener{ private Button button1; public Frame2() {  super("个人信息");      this.setSize(250,200);//设计组件的尺寸      this.setLocation(800

计算机界面,网格布局

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

事件监听 计算机界面

1.事件监听: package 事件监听;import java.awt.*;import java.awt.event.*;public  class Frame2 extends Frame implements ActionListener{ private Button button1; public Frame2() {  super("个人信息");      this.setSize(250,220);//设计组件的尺寸      this.setLocation(800

组建Windows家庭组

这里,是必须得针对Windows 7.8.10而言,因为,Windows XP 和 Windows Vista系统没有家庭网络的功能. 1.Windows家庭组的简介 使用家庭组,可轻松地在家庭网络上共享文件和打印机.其他人无法更改用户共享的文件,除非该用户授予其他用户执行此操作的权限. 如果家庭网络上不存在家庭组,则在设置Windows 7\8\10系统的计算机时,会自动创建一个家庭组.如果已经存在一个家庭组,则用户可以加入该家庭组.创建或加入家庭组后,可以选择要共享的库.用户可以阻止共享特定

腾讯云挂在和格式化数据盘

新购买了数据盘时,需要格式化才可使用.未购买数据盘的用户可以跳过此步骤.也可以根据需要进行多分区操作. 这里以Windows 2012R2为例进行格式化说明. 1) 通过步骤四介绍的方法登录Windows云服务器. 2) 点击[开始](Start)-[服务器管理器](Server Manager)-[工具](Tools)-[计算机管理](Computer Management)-[存储](Storage)-[磁盘管理](Disk Management). 3) 在需要格式化的新数据盘名称上,右键

如何将 Windows Server 2012 r2 打造成 Windows 8.1?

Server 系列相对于桌面系统Windows 8.1 .嵌入式系统Embedded 8.1来说,还是有所不同的,有其独特性,所以,标题写着“打造”充其量不过是不断接近的意思.还有很多地方存在进一步深入调试的可能性,大家共同探讨,无限接近.以下是安装原版系统后所需要的一些设置.设置过程中可能会提示重新启动,请按提示操作. 这些全是让你自己纯手工打造的,都可以返回默认设置,不是不可逆的. 一.组策略 WIN键+R键,输入GPEDIT.MSC,进入组策略设置. 1.计算机配置,Windows设置,安

分布式文件系统之创建 DFS 命名空间

有两种类型的DFS命名空间: 基于域的命名空间 独立命名空间 选择基于域的命名空间,需要配置在Active Directory中,这意味着你不必依赖一台服务器上提供的命名空间信息给您的客户.通过使用基于域的命名空间,如果你更改DFS命名空间服务的服务器名称更改为服务器的名称,不会有改变命名空间.该命名空间只有重命名域时才会更改.具有独立的DFS,配置存储在服务器上,并且服务器名称成为主路径命名空间的一部分. 创建DFS命名空间 1.打开"服务器管理器",选择"工具"

Android自动化测试Uiautomator--UiObject接口简介

UiObject可以理解为控件的对象,主要对对象进行操作.按照一定条件(UiSelector)获取UiObject对象,之后对对象进行相应的操作,如下图所示. 对于对象的操作主要有点击/长按.拖动/滑动.文本输入与清除.属性.对象是否存在.手势操作等. 点击与长按方面的方法: 举例:UiObject ok = new UiObject(new UiSelector().text("OK"));//声明对象 ok.click();//点击"OK" text. 1.pu

win7系统的虚拟机的NAT网络模式下的共享文件方式

本方法为NAT网络模式下的虚拟机与主机共享文件夹设置方式 首先设置虚拟机里的需要共享的文件夹 将文件共享选项的用户中设置为Everyone,选定后点击添加按钮,再点击共享按钮,最后点击弹出的窗口的确定按钮. 这里默认用户已经是NAT网络模式,所以不再赘述设置NAT网络模式. 在虚拟机中打开cmd命令窗口输入ipconfig命令查询虚拟机ip地址 在主机计算机界面右键添加一个网络位置 选择自定义网络位置 输入\\"刚才查询到的ip地址"\"共享文件夹名" 如:\\19