Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filling up the custom button background #61

Closed
SamuelShaw opened this issue Aug 11, 2016 · 9 comments
Closed

filling up the custom button background #61

SamuelShaw opened this issue Aug 11, 2016 · 9 comments

Comments

@SamuelShaw
Copy link

I am wanting to change the floating buttons to a custom 1 with a blue background. the image is round and is 1024 x 1024. When I place it into the code and run, the image is small and not filling up the default white background. How could I over come this?
screen shot 2016-08-11 at 12 31 41 pm

@kciter
Copy link
Owner

kciter commented Aug 12, 2016

You can use the KCFloatingActionButtonItem.buttonColor.
Below is simple example.

let item = KCFloatingActionButtonItem()
item.buttonColor = UIColor.blueColor()
item.title = "Custom item"
fab.addItem(item: item)

@SirSamShaw
Copy link

ok @kciter the problem is if I change the background color, the icon itself is still small unlike the icons that come with the KFAB example project. Would this have to do with the icon not being in an asset set? I noticed the default ones are in a set of three inside an asset set called icon (1, @2x, and @3x).

@kciter
Copy link
Owner

kciter commented Aug 16, 2016

@SirSamShaw
Can you give me your icons? I need re-produce.

@SirSamShaw
Copy link

yes thank you
add_visitor_btn
msg_btn
srch_btn

@kciter
Copy link
Owner

kciter commented Aug 17, 2016

Hello, @SirSamShaw
I'm sorry that late reply because the time difference.
KCFABItem's icon image size is 25x25 point. So, remove the your icons background color and shadow. And you should resize image to 25x25 point.

@SamuelShaw
Copy link
Author

ah ok Thank you!, do I need to place them in an asset set or can I just
place them in by name directly in code after I resize them??

On Tue, Aug 16, 2016 at 9:38 PM, Lee Sun-Hyoup notifications@github.com
wrote:

KCFABItem's icon image size is 25x25 point. So, remove the your icons
background color and shadow. And you should resize image to 25x25 point.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#61 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOLMafjs6qwprTjyER78LoOvwiEtdCOJks5qgmYHgaJpZM4JiTlq
.

@kciter
Copy link
Owner

kciter commented Aug 18, 2016

@SamuelShaw
KCFAB's item is already applied shadow and background color.
You can make using the design tool a transparent background and resize them.
Then, you place them in an asset set and add item in code.

var fab = KCFloatingActionButton()
fab.itemButtonColor = UIColor.blueColor() // Choose your color.
fab.addItem("title", icon: UIImage(named: "icName"))
// ...

@SirSamShaw
Copy link

ok, thank you!

@kciter kciter closed this as completed Aug 22, 2016
@preethichimerlaInspy
Copy link

Hi @kciter , @SirSamShaw how can I change the main fab icon image ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants