Comments (6)
what do you mean by scaling it ? having same icon size as button ?
from fancybuttons.
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: [email protected]
On Tue, Aug 18, 2015 at 4:14 AM, Mehdi Sakout [email protected]
wrote:
what do you mean by scaling it ? having same icon size as button ?
—
Reply to this email directly or view it on GitHub
#33 (comment).
from fancybuttons.
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
from fancybuttons.
@ToddManUtah any update on this ?
from fancybuttons.
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.
from fancybuttons.
Closing. If you still have the issue please re-open
from fancybuttons.
Related Issues (20)
- how to set textStyle="bold"
- how to remove the default text and show only drawable icon? HOT 1
- font not loaded HOT 1
- Black buttons that only show text "Fancy Buttons" HOT 5
- how i can set fb_fontIconResource HOT 4
- "fancy:fb_focusColor" not working in 1.9.0 HOT 2
- Auto complete not work
- stop using fancy namespace
- I cannot use implementation "com.android.support:appcompat-v7:$support_lib_version" HOT 1
- Ripple effect on click?
- How can I add gradient background drawable to a button? HOT 1
- When set radius programmatically, ripple effect gone?
- ripple effect doesn't work HOT 3
- 是否能加入对渐变颜色的支持? HOT 4
- Can't make Button text as bold
- Update to Font Awesome 5.8.2
- Method ‘setFontIconSize’ can‘t work when I put my iconresource in drawable and import it by using R.drawable.xxx HOT 1
- fb_textSize , fb_textAllCaps not work
- Dead library?
- Your library no longer works HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fancybuttons.