[Android实例] Android 简单计算器讲解.docx

  1. 1、本文档共7页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
悦成移动—移动互联网黄埔军校累计培训8万学员 只要12周 年薪14万 网址:/it/index.html/it/index.html或 百度悦成今天我们就来说说一个简单的计算器,我会把所有的的代码都会给大家贴出来,希望这个小的实例给大家代码一些灵感。不多说了,我们还是先来看看。效果图:当我们看见效果图以后,就会发现我们的这个计算器就是一个简单的。不多说废话了,我们现在就来看看string.xml的代码:java代码:?xml version=1.0 encoding=utf-8?resourcesstring name=helloHello World, MyCalculator!/stringstring name=app_nameCalculator/stringcolor name=black#000000/colorcolor name=write#FFFFFF/colorstring name=exit退出/stringstring name=about关于/stringcolor name=red#FF0000/color/resources复制代码我们现在来看看androidmanifest.xml里的代码,这个是很重要的,大家可要看好了。java代码:?xml version=1.0 encoding=utf-8?manifest xmlns:android=/apk/res/androidpackage=eoe.calculatorandroid:versionCode=2android:versionName=2.1uses-sdk android:minSdkVersion=4 /application android:icon=@drawable/icon android:label=@string/app_nameactivity android:name=.MyCalculatorandroid:label=@string/app_nameintent-filteraction android:name=ent.action.MAIN /category android:name=ent.category.LAUNCHER / /intent-filter/activity/application/manifest复制代码最后我们来看看main.xml代码,也就是我们的布局代码:java代码:?xml version=1.0 encoding=utf-8?LinearLayout xmlns:android=/apk/res/androidandroid:orientation=verticalandroid:layout_height=fill_parent android:layout_width=fill_parentTextViewandroid:id=@+id/lable android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=right android:singleLine=true android:scrollHorizontally=true android:background=@color/black android:textColor=@color/write android:layout_margin=5dip android:layout_marginBottom=5dip/TextViewandroid:id=@+id/showText android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=right android:textSize=33dip android:singleLine=true android:scrollHorizontally=true android:background=@color/black android:textColor=@color/write android:bufferType=editable android:layout_marginLeft=5dip android:maxLength=17 android:layout_marginRight=5dip/LinearLayout android:layout_width=fill_parent android:layout_height=wrap_content android:id=@+id/linearLayout1 android:gravi

文档评论(0)

白领文档(原创) + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档