求大神指导Android的按钮文字对齐,上面按钮。

一名Android初学者在一周的学习后遇到了计算器界面中按钮文字对齐的困扰,希望得到大神的指点。
摘要由CSDN通过智能技术生成

萌新,求大神指导。
才学Android一个星期,做计算器界面0不知道怎么对齐上面按钮左边是iPhone的,右边写的

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




<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="2">
    <Button
        android:id="@+id/bt1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/arithmetic_shape"
        android:text="AC"
        android:textSize="35dp"
        android:textColor="#000000"
        android:layout_weight="1"
        android:layout_margin="8dp"/>
    <Button
        android:id="@+id/bt2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/arithmetic_shape"
        android:text="+/-"
        android:textSize="30dp"
        android:textColor="#000000"
        android:layout_weight="1"
        android:layout_margin="8dp"/>
    <Button
        android:id="@+id/bt3"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/arithmetic_shape"
        android:text="%"
        android:textSize="50dp"
        android:textColor="#000000"
        android:layout_weight="1"
        android:layout_margin="8dp"/>

    <Button
        android:id="@+id/bt4"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/operator_shape"
        android:text="÷"
        android:textColor="#ffff"
        android:textSize="50dp"
        android:layout_margin="8dp"/>

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="2">
    <Button
        android:id="@+id/bt5"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/figure_shape"
        android:text="7"
        android:textSize="45dp"
        android:textColor="#ffff"
        android:layout_weight="1"
        android:layout_margin="8dp"/>

    <Button
        android:id="@+id/bt6"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="8dp"
        android:layout_weight="1"
        android:background="@drawable/figure_shape"
        android:text="8"
        android:textColor="#ffff"
        android:textSize="45dp" />

    <Button
        android:id="@+id/bt7"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/figure_shape"
        android:text="9"
        android:textSize="45dp"
        android:textColor="#ffff"
        android:layout_weight="1"
        android:layout_margin="8dp"/>

    <Button
        android:id="@+id/bt8"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/operator_shape"
        android:text="×"
        an
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值