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

Android开发之计算器(一)界面设计之activity_main布局文件的更多相关文章

  1. [Android] Android开发优化之——对界面UI的优化(2)

    在Android应用开发过程中,屏幕上控件的布局代码和程序的逻辑代码通常是分开的.界面的布局代码是放在一个独立的xml文件中的,这个文件里面是树型组织的,控制着页面的布局.通常,在这个页面中会用到很多 ...

  2. [Android] Android开发优化之——对界面UI的优化(1)

    在Android应用开发过程中,屏幕上控件的布局代码和程序的逻辑代码通常是分开的.界面的布局代码是放在一个独立的xml文件中的,这个文件里面是树型组织的,控制着页面的布局.通常,在这个页面中会用到很多 ...

  3. Android开发之计算器(一)界面设计

    计算器开发主要涉及到LinearLayout布局.EditText.Button的使用.为android入门基础内容. 打开android studio选择创建一个新的工程,应用程序的名称为Calcu ...

  4. 《第一行代码--Android》阅读笔记之界面设计

    1.单位dp.dip.sp.pt.px.in.mm 这里引用StackOverFlow上的一个解答: px is one pixel. sp is scale-independent pixels. ...

  5. eclipse Android 开发基础 Activity 窗体 界面

    eclipse Android 开发基础 新建工程 新建布局layout,new Android Activity就相当于窗体Form. 新建Activity自动生成src下同名的java代码. pu ...

  6. Android开发优化之——对界面UI的优化(1)

    在Android应用开发过程中,屏幕上控件的布局代码和程序的逻辑代码通常是分开 的.界面的布局代码是放在一个独立的xml文件中的,这个文件里面是树型组织的,控制着页面的布局.通常,在这个页面中会用到很 ...

  7. Android开发:碎片Fragment完全解析fragment_main.xml/activity_main.xml

    Android开发:碎片Fragment完全解析   为了让界面可以在平板上更好地展示,Android在3.0版本引入了Fragment(碎片)功能,它非常类似于Activity,可以像 Activi ...

  8. Android开发:碎片Fragment完全解析fragment_main.xml/activity_main.xml(转)

    注明:这个转的,见谅未能标明原始出处 我们都知道,Android上的界面展示都是通过Activity实现的,Activity实在是太常用了,我相信大家都已经非常熟悉了,这里就不再赘述. 但是Activ ...

  9. Android 手机卫士--实现设置界面的一个条目布局结构

    本文地址:http://www.cnblogs.com/wuyudong/p/5908986.html,转载请注明源地址. 本文以及后续文章,将一步步完善功能列表: 要点击九宫格中的条目,需要注册点击 ...

随机推荐

  1. C# 之 System.Diagnostics.Process.Start的妙用

    经常会遇到在Winform或是WPF中点击链接或按钮打开某个指定的网址, 或者是需要打开电脑中某个指定的硬盘分区及文件夹, 甚至是"控制面板"相关的东西, 如何做呢? 方法:使用S ...

  2. LOG4NET开源日志dll引用流程,在net3.5中已经实践ok

    一,在app.config中配置 <?xml version="1.0"?><configuration> <configSections> & ...

  3. (转)乐观的并发策略——基于CAS的自旋

    悲观者与乐观者的做事方式完全不一样,悲观者的人生观是一件事情我必须要百分之百完全控制才会去做,否则就认为这件事情一定会出问题:而乐观者的人生观则相反,凡事不管最终结果如何,他都会先尝试去做,大不了最后 ...

  4. AliasRegistry接口

    Spring - 4.2.3 // 将一个name注册为一个别名aliasvoid registerAlias(String name, String alias);// 移除一个别名aliasvoi ...

  5. extjs采用fileupload进行文件上传后台实现

    前台js: form: Ext.define("GS.base.BasicImportForm",{    extend:"Ext.form.Panel",   ...

  6. iOS 虚拟机测试出现的相关问题

    一.报红 1.问题描述:自己在工程目录下新建文件夹 包其他文件夹下的.h 和.m文件拖到该文件夹 再删除工程中的报红文件复制进去新文件夹 运行报错:No such file or directory: ...

  7. Oracle 基础 数据库备份与恢复

    一.为什么需要数据备份 造成数据丢失的主要原因: 1.介质故障. 2.用户的错误操作. 3.服务器的彻底崩溃. 4.计算机病毒. 5.不可预料的因素. Oracle中故障类型分为以下4种. 1.语句故 ...

  8. sourcetree下回退

    上篇 最后展示了再命令行下回退的功能,再来看看sourcetree下如何操作 新建 新建文本文档.txt,添加一行"第一次“,并提交 1.添加一行"第二次",现在修改只在 ...

  9. hdu 3585 二分+最大团

    题目:给出平面上n个点,现在找m个点,并且使得这m个点最近的两个最远. 分析:显然这满足二分的性质,二分答案,根据点距离需要大于等于二分值重新构造新图,则问题变成了:在新图中找出满足所有点对之间的距离 ...

  10. 关于cornerstone无法上传library文件的问题

    在CornerStone中先选中左边的项目: 然后在菜单栏里面选择View->ShowIgnoreItems, 再选择项目中的library文件,点击Add按钮即可上传到服务器: