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

    使用Blend制作PathAnimation 1:选中Path转换为运动路径 2:选择目标对象 PathAnimation使用动态的Path PathAnimation动画在播放的时候,PahtGeo ...

  2. Mispelling4

    Problem Description Misspelling is an art form that students seem to excel at. Write a program that ...

  3. A+B Coming

    Problem Description Many classmates said to me that A+B is must needs.If you can’t AC this problem, ...

  4. WinDBG快速定位异常位置

    在WinDBG中通过搜索内存中保存的CONTEXT结构来定位发生的异常信息,再通过WinDBG命令.cxr显示对应的调用堆栈信息.   .foreach ( place { s-[1]d 0 L?FF ...

  5. 【AsyncTask整理 1】 AsyncTask几点要注意的地方

    问题1:AsyncTask是多线程吗? 答:是. 问题2:AsyncTask与Handler相比,谁更轻量级? 答:通过看源码,发现AsyncTask实际上就是一个线程池,而网上的说法是AsyncTa ...

  6. git管理工具的使用教程

    Git入门教程 1.   概述     对于软件版本管理工具,为什么要选择Git?      你真正学会使用Git时, 你就会觉得这个问题的回答是非常自然的.然而当真正需要用文字来回答时,却觉得文字好 ...

  7. 使用Nginx SSI功能辅助HTML页面设计

    SSI,Server Side Include,支持html静态文件内以 <!--#include file="/layout/header.html"-->  的方式 ...

  8. CentOS里下载百度网盘 / 360 网盘资源的方法

    wget -c --referer=引用地址 -O 文件名 "真实下载地址" 例如,我下载资源原在的页面为http://pan.baidu.com/s/1cfJXZ ,实际下载地址 ...

  9. Oracle数据库作业-1

    设有一数据库,包括四个表:学生表(Student).课程表(Course).成绩表(Score)以及教师信息表(Teacher).四个表的结构分别如表1-1的表(一)~表(四)所示,数据如表1-2的表 ...

  10. 如何取消IE“已限制此网页运行可以访问计算机的脚本或ActiveX控件

    在本地调试html页,如果其中包含js或flash,IE经常会提示“IE已限制此网页运行可以访问计算机的脚本或ActiveX控件”.虽然IE出于安全考虑阻止本地脚本运行这个做法没错,但作为程序开发者来 ...