<?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. 如何通过apt-get获得安装包的源码

    有时候我们需要获得某个可执行程序的源码,而不仅仅是一个可执行程序,比如我们想获取tree这个工具的源码,这时候就可以采用下面的命令: sudo apt-get source tree pengdl@d ...

  2. 小白日记52:kali渗透测试之Web渗透-HTTPS攻击(Openssl、sslscan、sslyze、检查SSL的网站)

    HTTPS攻击 全站HTTPS正策划稿那位潮流趋势 如:百度.阿里 HTTPS的作用 CIA 解决的是信息传输过程中数据被篡改.窃取 [从中注入恶意代码,多为链路劫持] 加密:对称.非对称.单向 HT ...

  3. SQL 必知必会-- 第17课:创建和操作表

    我这里用的是oracle 10g,PL/SQL来做的. 第17课  创建和操纵表  14517.1  创建表  14517.2  更新表  15017.3  删除表  15317.4  重命名表  1 ...

  4. 【python调用windows CLI】调用adb统计Android app的流量消耗

    主要记录python如何调用windows CLI 手机连接PC,adb devices可以看到手机sn 通过adb 获取指定app的processID UID 读取Android  /proc/ne ...

  5. 用xcode6.3编译早期工程时出现Undefined symbols for architecture x86_64错误的解决办法(转)

    Xcode升级到5.1 新特性之一就是默认让所有App都通过64位编译器编译.原来在Xcode5.0.x的时候默认的Standard architectures只有(arm7,armv7s),到5.1 ...

  6. How to Use Rsync to Sync New or Changed/Modified Files in Linux

    As a system administrator or Linux power user, you may have probably come across or even on several ...

  7. 4560 NOIP2015 D2T2 子串

    4560 NOIP2015 D2T2 子串  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题解  查看运行结果     题目描述 Description 有两 ...

  8. photoSlider-原生js移动开发轮播图、相册滑动插件

    详细内容请点击 在线预览   立即下载 使用方法: 分别引用css文件和js文件 如: <link rel="stylesheet" type="text/css& ...

  9. DWZ(JUI) 教程 普通表单提交

    一类是普通的表单提交,另一类就是列表页面的表单提交,主要是用来查询搜索列表使用的.今天我就简单介绍一下前者. 这是官网上的普通列表页面, <div class="pageContent ...

  10. Android常用系统广播

    关于Intent的使用,可参阅前章:http://www.cnblogs.com/caidupingblogs/p/5101669.html //关闭或打开飞行模式时的广播 Intent.ACTION ...