layout
absolute_layout
<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:orIEntation="vertical" androID:layout_wIDth="match_parent" androID:layout_height="match_parent"><linearLayout androID:layout_wIDth="match_parent" androID:layout_height="80dp" androID:orIEntation="horizontal"> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="C" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="+/-" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="%" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle_orange" androID:text="÷" androID:textSize="30sp"/></linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="80dp" androID:orIEntation="horizontal"> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="7" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="8" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="9" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle_orange" androID:text="×" androID:textSize="30sp"/> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="80dp" androID:orIEntation="horizontal"> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="4" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="5" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="6" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle_orange" androID:text="-" androID:textSize="30sp"/> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="80dp" androID:orIEntation="horizontal"> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="1" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle" androID:text="2" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:text="3" androID:background="@drawable/shape_rectangle" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:background="@drawable/shape_rectangle_orange" androID:text="+" androID:textSize="30sp"/> </linearLayout> <linearLayout androID:layout_wIDth="match_parent" androID:layout_height="80dp" androID:orIEntation="horizontal"> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="2" androID:gravity="center_vertical" androID:paddingleft="40dp" androID:text="0" androID:background="@drawable/shape_rectangle" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:text="." androID:background="@drawable/shape_rectangle" androID:textSize="30sp"/> <TextVIEw androID:layout_wIDth="0dp" androID:layout_height="match_parent" androID:layout_weight="1" androID:gravity="center" androID:text="=" androID:background="@drawable/shape_rectangle" androID:textSize="30sp"/> </linearLayout></linearLayout>
drawable
shape_recangle.xml
<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID"> androID:shape="rectangle"> <solID androID:color="#ffffff"/> <stroke androID:color="#333333" androID:wIDth="1dp"/></shape>
shape_recangle_orange.xml
<?xml version="1.0" enCoding="utf-8"?><shape xmlns:androID="http://schemas.androID.com/apk/res/androID"> androID:shape="rectangle"> <solID androID:color="#e47f26"/> <stroke androID:color="#333333" androID:wIDth="1dp"/></shape>总结
以上是内存溢出为你收集整理的实现一个计算器的例子全部内容,希望文章能够帮你解决实现一个计算器的例子所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)