的ImageButton Android中ImageButton、Android

2023-09-12 09:14:45 作者:血涙メ弑炫

谁能告诉我如何调整的ImageButton以适应图像exactly..This是code,我试过,但图像被放置在我使用定位的位置 安卓scaleType 但我不能能够减少的ImageButton的大小,请帮我在纠正这个问题......在code,我试过的。 ..

 <的ImageButton>
机器人:ID =@ + ID / Button01
机器人:scaleType =fitXY//我已经尝试了所有的值,这个ATTR
机器人:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
机器人:cropToPadding =假
机器人:以下属性来=10dp
机器人:SRC =@可绘制/眼> //这是图像(眼睛)
< / ImageButton的>
 

解决方案

有点儿晚,但即时通讯全部为更好的后期从来就不是' 今天我有同样的问题,在这里找到解释: 的http://www.anddev.org/tutorial_buttons_with_niceley_stretched_background-t4369.html

Can anybody tell me how to resize the imageButton to fit the image exactly..This is the code that i tried, but the image is placed at the position that i am locating using android:scaleType but i can't able to reduce the size of imageButton, pls help me out in rectifying this issue...The code that i tried is ...

<ImageButton>
android:id="@+id/Button01"
android:scaleType="fitXY" // i have tried all the values for this attr
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:cropToPadding="false"
android:paddingLeft="10dp"
android:src="@drawable/eye"> // this is the image(eye)
</ImageButton>
android开发中如何设置ImageButton的大小

解决方案

Kinda late, but im all for 'better late then never' I had the same question today, found it explained here: http://www.anddev.org/tutorial_buttons_with_niceley_stretched_background-t4369.html