缩放里面一个按钮绘制? [英] Scaling a drawable inside a button?

查看:116
本文介绍了缩放里面一个按钮绘制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我绘制只是扩展到它的正常大小,我希望它适合我的按钮内部。下面是它现在怎么看起来画面:

Currently my drawable just scales to it's normal size, I want it to fit inside my button. Here's a picture of how it looks now:

下面是XML的按钮:

<LinearLayout android:layout_width="wrap_content"
    android:id="@+id/linearLayout2" android:layout_height="40dp"
    android:layout_weight="0.4" android:gravity="right|center_vertical"
    android:paddingRight="5dp">
    <Button android:id="@+id/button1" android:background="@drawable/refresh"
        android:layout_height="25dp" android:layout_width="150dp"
        android:text="@string/buttonSearchAgain" android:drawableRight="@drawable/refresh_48"></Button>
</LinearLayout>

所以,我希望它看起来是这样的:

So I want it to look like this:

有没有什么办法可以缩小我的绘制?

Is there any way I can shrink my drawable?

推荐答案

重新创建图像。保持图像的大小,像素,但降低的箭头的大小,然后将剩下透明的。这是我的赌注反正=)

Recreate the image. Keep image size in pixels but reduce the size of the arrow and make the rest transparent. That's my bet anyway =)

这篇关于缩放里面一个按钮绘制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆