
我正在尝试创建一个按钮,其中文本描述位于底部,图像位于顶部.我看到按钮可以通过android:drawabletop属性执行 *** 作,但我无法调整图像大小
adjustVIEwBounds,androID:scaleType =“fitCenter”,fitXY等方法无效.
这是我的按钮的xml代码
<button androID:text="Start Running" androID:layout_height="match_parent" androID:layout_wIDth="0dp" androID:layout_weight="1" androID:ID="@+ID/run" androID:onClick = "RUN" androID:scaleType="fitCenter" androID:drawabletop="@drawable/runner" androID:layout_marginBottom="3sp" androID:layout_marginleft="2sp" androID:layout_marginRight="3sp" androID:layout_margintop="0sp" />请提出建议?
解决方法:
创建水平linearLayout,其中包含2个视图 – 将图像设置为背景,使用相应文本设置TextVIEw.之后为此linearLayout设置OnClickListener并像常规按钮一样处理它.
总结以上是内存溢出为你收集整理的android – 如何调整按钮内的图像大小全部内容,希望文章能够帮你解决android – 如何调整按钮内的图像大小所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)