Closed ToddManUtah closed 8 years ago
what do you mean by scaling it ? having same icon size as button ?
I have a graphic that is 150x150. I want the button to be 30x30. The problem is, that I can't get the graphic to scale within the button. If I make the graphic 30x30, then it works. If I don't, the button ends up being huge.
Does that make sense?
Using the standard button, I was able to set the size of the button and instruct the button to scale the image to fit inside those dimensions. I can't quite figure out how to make the FancyButton do the same thing.
Todd Lawson Business: 801-609-8633 Email: todd.c.lawson@gmail.com
On Tue, Aug 18, 2015 at 4:14 AM, Mehdi Sakout notifications@github.com wrote:
what do you mean by scaling it ? having same icon size as button ?
— Reply to this email directly or view it on GitHub https://github.com/medyo/fancybuttons/issues/33#issuecomment-132156961.
I think you should define a ScaleType for the fancybutton Image like so myfancybutton. getIconImageObject().setScaleType(ScaleType.X);
Change X by the suitable one : http://developer.android.com/reference/android/widget/ImageView.ScaleType.html
@ToddManUtah any update on this ?
I just tried it and still no luck. The graphic isn't scaled down. Here's my code:
refreshButton = (FancyButton) view.findViewById(R.id.app_list_refresh_button);
refreshButton.getIconImageObject().setScaleType(ImageView.ScaleType.FIT_CENTER);
I also tried several other scale types. All allowed the button to grow beyond the bounds defined for the button. Here is the button xml:
<mehdi.sakout.fancybuttons.FancyButton
android:id="@+id/app_list_refresh_button"
android:layout_width="25dp"
android:layout_height="25dp"
android:padding="5dp"
fancy:fb_iconResource="@drawable/button_refresh"
fancy:fb_fontIconSize="25dp"
fancy:fb_iconPaddingTop="5dp"
fancy:fb_iconPaddingBottom="5dp"
fancy:fb_iconPaddingLeft="5dp"
fancy:fb_iconPaddingRight="5dp"
fancy:fb_defaultColor="#696969"
fancy:fb_focusColor="#a9a9a9"
fancy:fb_radius="5dp"/>
The graphic I'm using is 150x150.
Closing. If you still have the issue please re-open
Does the library support scaling of graphics?
I have a ImageButtton I'm trying to replace. I have it working with ImageButton with the following:
<ImageButton
The image is 256x256 and I'm trying to have the button scale it down to fit into the FancyButton. But, I can't get it to scale down.