首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >让按钮具有相同大小

让按钮具有相同大小
EN

Stack Overflow用户
提问于 2012-01-06 09:10:37
回答 2查看 541关注 0票数 0

我的布局代码如下:

代码语言:javascript
复制
    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btn_left"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1.0"
            android:text="Phone Files" />

        <TextView
            android:id="@+id/list_title"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:gravity="center_horizontal"
            android:text="Photos"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <Button
            android:id="@+id/btn_right"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1.0"
            android:text="Save" />
    </LinearLayout>

如何让btn_left和btn_right大小一致?

EN

Stack Overflow用户

发布于 2012-01-06 09:12:45

尝试将android:weightSum="2.5"作为属性添加到LinearLayout标签中,并将所有三个小部件的layout_width值更改为android:layout_width="0dip"

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8752202

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档