当前位置: 首页 > news >正文

Android开发之计算器(一)界面设计之activity_main布局文件

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    tools:context="com.sesametech.mazyi.calculateapp.MainActivity">
    <EditText
        android:id="@+id/edittext"
        android:gravity="right"
        android:hint="0"
        android:textColorHint="#000000"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:selectAllOnFocus="false"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        android:inputType="none"/>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/clear"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="C"
            android:background="#307Dee"/>
        <Button
            android:id="@+id/del"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="DEL"/>
        <Button
            android:id="@+id/div"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="/"/>
        <Button
            android:id="@+id/multi"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="*"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/seven"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="7"/>
        <Button
            android:id="@+id/eight"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="8"/>
        <Button
            android:id="@+id/nine"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="9"/>
        <Button
            android:id="@+id/minus"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="-"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/four"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="4"/>
        <Button
            android:id="@+id/five"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="5"/>
        <Button
            android:id="@+id/six"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="6"/>
        <Button
            android:id="@+id/plus"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="+"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Button
            android:id="@+id/one"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="1"/>
        <Button
            android:id="@+id/two"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="2"/>
        <Button
            android:id="@+id/three"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="3"/>
        <Button
            android:id="@+id/parenthesis"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="( )"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginBottom="0dp">
        <Button
            android:id="@+id/zero"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="0"/>
        <Button
            android:id="@+id/dot"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="."/>
        <Button
            android:id="@+id/plusorminus"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="+/-"/>
        <Button
            android:id="@+id/equals"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="="
            android:background="#F07D22"/>
    </LinearLayout>
</LinearLayout>

转载于:https://my.oschina.net/mzy666888/blog/788293

相关文章:

  • 再谈Redirect(客户端重定向)和Dispatch(服务器端重定向)
  • 男神的补习
  • 360浏览器兼容模式 不能$.post (不是a 连接 onclick的问题!!)
  • Fluent NHibernate系列文章
  • 第八次作业
  • 计算思维导论
  • maven项目搭建
  • 图像识别技术
  • RTP协议
  • Java中Vector和ArrayList的区别
  • 如何培养数据分析的能力?
  • zabbix根据主机和端口列表自动发现监控远程MongoDB实例
  • [转载]浅析海量用户的分布式系统设计
  • heroku 部署nodejs+mongodb
  • 仿QQ大战—服务器的搭建(ServerSocket)
  • 分享一款快速APP功能测试工具
  • 【402天】跃迁之路——程序员高效学习方法论探索系列(实验阶段159-2018.03.14)...
  • 【mysql】环境安装、服务启动、密码设置
  • angular学习第一篇-----环境搭建
  • ES学习笔记(10)--ES6中的函数和数组补漏
  • input的行数自动增减
  • JavaScript学习总结——原型
  • Java基本数据类型之Number
  • v-if和v-for连用出现的问题
  • 从setTimeout-setInterval看JS线程
  • 那些被忽略的 JavaScript 数组方法细节
  • 入口文件开始,分析Vue源码实现
  • 扫描识别控件Dynamic Web TWAIN v12.2发布,改进SSL证书
  • 关于Kubernetes Dashboard漏洞CVE-2018-18264的修复公告
  • ​LeetCode解法汇总307. 区域和检索 - 数组可修改
  • #AngularJS#$sce.trustAsResourceUrl
  • ( )的作用是将计算机中的信息传送给用户,计算机应用基础 吉大15春学期《计算机应用基础》在线作业二及答案...
  • (145)光线追踪距离场柔和阴影
  • (52)只出现一次的数字III
  • (Bean工厂的后处理器入门)学习Spring的第七天
  • (安卓)跳转应用市场APP详情页的方式
  • (附源码)ssm旅游企业财务管理系统 毕业设计 102100
  • (附源码)计算机毕业设计ssm-Java网名推荐系统
  • (附源码)小程序儿童艺术培训机构教育管理小程序 毕业设计 201740
  • (强烈推荐)移动端音视频从零到上手(下)
  • (一)UDP基本编程步骤
  • (一)基于IDEA的JAVA基础12
  • (转)利用PHP的debug_backtrace函数,实现PHP文件权限管理、动态加载 【反射】...
  • (转)清华学霸演讲稿:永远不要说你已经尽力了
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • .NET精简框架的“无法找到资源程序集”异常释疑
  • .NET牛人应该知道些什么(2):中级.NET开发人员
  • .net中调用windows performance记录性能信息
  • @FeignClient 调用另一个服务的test环境,实际上却调用了另一个环境testone的接口,这其中牵扯到k8s容器外容器内的问题,注册到eureka上的是容器外的旧版本...
  • @RequestMapping用法详解
  • [ MSF使用实例 ] 利用永恒之蓝(MS17-010)漏洞导致windows靶机蓝屏并获取靶机权限
  • [Android View] 可绘制形状 (Shape Xml)
  • [Android实例] 保持屏幕长亮的两种方法 [转]
  • [C++]拼图游戏
  • [CISCN2019 华东南赛区]Web11