如何在不使用新图像的情况下减小android中单选按钮上显示的图像大小

如何在不使用新图像的情况下减小android中单选按钮上显示的图像大小,第1张

概述我设计了一个活动,其中有两个单选按钮但是那些尺寸绰绰有余我想减少它我使用的文本大小只减少文本如果布局大小减少,只减少视图而不是单选按钮圈<RadioGroupandroid:id="@+id/RG1"android:layout_width="wrap_content"android:layout_height="wrap_c

我设计了一个活动,其中有两个单选按钮
但是那些尺寸绰绰有余我想减少它
我使用的文本大小只减少文本
如果布局大小减少,只减少视图而不是单选按钮圈

<RadioGroup        androID:ID="@+ID/RG1"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        androID:orIEntation="horizontal" >        <Radiobutton            androID:ID="@+ID/N"            androID:layout_wIDth="wrap_content"            androID:layout_height="30dip"            androID:text="Yes"            androID:textSize="12dip" />        <Radiobutton            androID:ID="@+ID/Y"            androID:layout_wIDth="wrap_content"            androID:layout_height="30dip"            androID:checked="true"            androID:text="No"            androID:textSize="12dip" />    </RadioGroup>

解决方法:

为此,您可以使用选择器

<selector xmlns:androID="http://schemas.androID.com/apk/res/androID"><item androID:drawable="@drawable/1"     androID:state_pressed="true"/>  <item androID:drawable="@drawable/2"     androID:state_checked="true"/>  <item androID:drawable="@drawable/3"     androID:state_focused="true" /><item androID:drawable="@drawable/4" />  </selector> 

在radiobutton标签中,您可以添加

androID:button="@drawable/above"androID:layout_height="20dp"androID:layout_wIDth="wrap_content"

希望它有所帮助.您可能还想看看这个link

总结

以上是内存溢出为你收集整理的如何在不使用新图像的情况下减小android中单选按钮上显示的图像大小全部内容,希望文章能够帮你解决如何在不使用新图像的情况下减小android中单选按钮上显示的图像大小所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存