两个按钮相同宽度的android

两个按钮相同宽度的android,第1张

概述<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apkes/android"android:layout_width="fill_parent"android:layout_height="match_parent"

<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"    androID:layout_height="match_parent"    androID:orIEntation="vertical" >    <relativeLayout        androID:layout_wIDth="100dp"        androID:layout_height="wrap_content"        androID:layout_centerHorizontal="true"        androID:layout_centerVertical="true" >    <button        androID:ID="@+ID/bb"        androID:layout_weight="1"        androID:layout_wIDth="0dp"        androID:layout_height="wrap_content"        androID:drawableleft="@drawable/bb"        androID:drawablepadding="5dp"        androID:text="bb" />    <button        androID:ID="@+ID/cc"        androID:layout_weight="1"        androID:layout_wIDth="0dp"        androID:layout_height="wrap_content"        androID:layout_below="@ID/bb"        androID:drawableleft="@drawable/cc"        androID:drawablepadding="5dp"        androID:text="cc" />    </relativeLayout></relativeLayout>

屏幕上应该有两个按钮,中间的宽度相同.但是除了黑屏x.x
我并不是开发AndroID的新手,但有时我会错过一些小细节,这让我很头疼.对不起打扰

解决方法:

androID:layout_weight

不适用于relativeLayout

删除这些行并设置

androID:layout_wIDth="match_parent"

在两个按钮上.

总结

以上是内存溢出为你收集整理的两个按钮相同宽度的android全部内容,希望文章能够帮你解决两个按钮相同宽度的android所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1211222.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存