Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android布局练习—计算器 #5

Open
huruji opened this issue Sep 3, 2017 · 1 comment
Open

Android布局练习—计算器 #5

huruji opened this issue Sep 3, 2017 · 1 comment
Labels

Comments

@huruji
Copy link
Owner

huruji commented Sep 3, 2017

小菜鸟布局第一次布局,orz

<RelativeLayout android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TableLayout
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_alignParentBottom="true"
        android:stretchColumns="*">
        <TextView android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:text="0"
            android:gravity="right|center_vertical"/>
        <TableRow android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="80dp">
            <Button android:id="@+id/button1"
                android:layout_height="80dp"
                android:layout_width="wrap_content"
                android:text="7"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button2"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="8"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button3"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="9"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button4"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="/"
                android:background="#db8122"
                />
        </TableRow>
        <TableRow android:id="@+id/tableRow2"
            android:layout_height="80dp"
            android:layout_width="wrap_content"
            android:layout_marginTop="1dp">
            <Button android:id="@+id/button5"
                android:layout_height="80dp"
                android:layout_width="wrap_content"
                android:text="4"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button6"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="5"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button7"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="6"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button8"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="*"
                android:background="#db8122" />
        </TableRow>
        <TableRow android:id="@+id/tableRow3"
            android:layout_height="80dp"
            android:layout_width="wrap_content"
            android:layout_marginTop="1dp">
            <Button android:id="@+id/button9"
                android:layout_height="80dp"
                android:layout_width="wrap_content"
                android:text="1"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button10"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="2"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button11"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="3"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button12"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="-"
                android:background="#db8122"/>
        </TableRow>
        <TableRow android:id="@+id/tableRow4"
            android:layout_height="80dp"
            android:layout_width="wrap_content"
            android:layout_marginTop="1dp">
            <Button android:id="@+id/button13"
                android:layout_height="80dp"
                android:layout_width="wrap_content"
                android:text="0"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button14"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="."
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button15"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="+"
                android:background="#0a89b6"
                android:layout_marginRight="1dp"/>
            <Button android:id="@+id/button16"
                android:layout_height="match_parent"
                android:layout_width="wrap_content"
                android:text="="
                android:background="#db8122"
                android:/>
        </TableRow>

    </TableLayout>
</RelativeLayout>

截图:
screenshot_2017-09-03-18-30-46-155_com example hu

@huruji huruji added the Android label Sep 3, 2017
@HolynnChen
Copy link

可以支持科学计算式吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants