你好,游客 登录 注册 搜索
背景:
阅读新闻

Android开发之SimpleCalculate简易单行计算器源码

[日期:2012-12-28] 来源:Linux社区  作者:zxjzzg [字体:大 中 小]

布局文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    style="@style/style"
    >
     
 <EditText
    android:id="@+id/factorOne"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:numeric="signed"
    />
   
    <!-- android:numeric="signed"可以预设输入法为输入数字 -->
   
    <Button
    android:id="@+id/minus"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    />
   
 <EditText
    android:id="@+id/factorTwo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:numeric="signed"
    />
 <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="="
    android:layout_weight="1"
   
    />
 <Button
    android:id="@+id/result"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    />
</LinearLayout>
 <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/filename"
    />
 <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/content"
    />
 

</LinearLayout>

赋值文件很简单,不上了

看看效果:

Android开发之SimpleCalculate简易单行计算器

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款