当前位置:操作系统 > 安卓/Android >>

android计算器原创【安卓进化三】

 

上个例子我做了个简单的计算器,现在抽空弄个了复杂点的。 具体步骤如下:

先看效果:点击96*96=9216,其他运算一样,我这里就不一一截图了!

 

 

 


96    *                        96                     ==   9216

\          \           \

  点击菜单按钮后:                       点击关于选项后:

   \        \                                                                                  

 

 

一、xml代码,main.xml代码如下:

 

 

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

    android:orientation="vertical" 

    android:layout_width="fill_parent" 

    android:layout_height="fill_parent" 

    > 

 <TextView   

     android:layout_width="fill_parent"  

     android:layout_height="wrap_content"  

     android:text="大明原创" 

     /> 

 <EditText 

 

    android:id="@+id/showText" 

     android:layout_width="150px" 

     android:layout_height="38px" 

 /> 

   <TableLayout  xmlns:android="http://schemas.android.com/apk/res/android" 

        android:layout_width="fill_parent" 

        android:layout_height="fill_parent"> 

        <TableRow> 

    <TableLayout  xmlns:android="http://schemas.android.com/apk/res/android" 

        android:layout_width="fill_parent" 

        android:layout_height="fill_parent"> 

        <TableRow> 

             <Button 

               android:id="@+id/num1" 

               android:layout_width="38px" 

     &n

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,