Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

UIMenuViewController button style #72

Closed
skytoup opened this issue Oct 13, 2015 · 9 comments
Closed

UIMenuViewController button style #72

skytoup opened this issue Oct 13, 2015 · 9 comments
Assignees

Comments

@skytoup
Copy link

skytoup commented Oct 13, 2015

png

UIColor *c = [UIColor colorWithGradientStyle:UIGradientStyleRadial withFrame:CGRectMake(0, 0, 960, 960) andColors:@[[UIColor flatBlueColor], [UIColor flatPowderBlueColor]] ];
[Chameleon setGlobalThemeUsingPrimaryColor:c withSecondaryColor:c andContentStyle:UIContentStyleLight];

button is ugly

@bre7
Copy link
Collaborator

bre7 commented Oct 13, 2015

  1. I'm not sure if gradients were meant to be used with GlobalTheme functions. (But wait for Vic to respond just in case)
  2. GlobalTheme functions set every UIButton's style using a bg color only (no rounded borders...So they'll look like solid rectangles/squares).

Also, what do you mean by ugly ? Are you reporting a bug or is the dark view behind the button intended ? GlobalTheme functions are just a starting point, you should customize any specific view as you see fit (e.g: rounded corners, shadows, border width, etc.)

@skytoup
Copy link
Author

skytoup commented Oct 13, 2015

using the [Chameleon setGlobalThemeUsingPrimaryColor:withSecondaryColor:andContentStyle:] function, which leads to the UIMenuViewController is not beautiful.
Because the UIMenuViewController button is a rounded corners, but the set up is a rectangles

@bre7
Copy link
Collaborator

bre7 commented Oct 13, 2015

Rounded corners can't be set globally using the Appearance protocol, so it's up to you to do so.
@ViccAlexander Is there a way to ignore UIMenuViewController's buttons when setting up the theme?

@skytoup
Copy link
Author

skytoup commented Oct 13, 2015

I mean, Chameleor set a theme, affecting UIMenuViewController button style, make it ugly

@vicc
Copy link
Owner

vicc commented Oct 16, 2015

@skytoup Due to the way in which gradient colors are generated, gradient colors should not be expected to work with themes. The reason for this is due to frame sizes. Gradient colors are generated as an image, which is then used to color an element. The element's size needs to be known ahead of time for this to work. However because theming occurs prior to the creation of elements, unexpected results may occur. I'll look into finding a way for this to hopefully change, but I can't promise anything.

As for the UIMenuViewController, I'll look into finding a way to support this.

@vicc vicc modified the milestone: Chameleon 2.0 Oct 16, 2015
@vicc vicc self-assigned this Oct 16, 2015
@vicc vicc added the Planned label Oct 16, 2015
@skytoup
Copy link
Author

skytoup commented Oct 17, 2015

Actually I just want you to see if there are any way to change it nicely~~~

@vicc
Copy link
Owner

vicc commented Nov 26, 2015

@skytoup Sorry it's taken long for me to get to this. 😞 I've looked into it and unfortunately it looks like there's no way of correcting the look of the UIMenuController items without affecting the appearance of all UIButtons. Our best bet would be for Apple to allow UIMenuController to conform to the UIAppearance protocol. It seems to be more of an Apple limitation than anything.

Alternatively, here's your options:

  1. Use a third party menu controller instead (MenuPopOverView looks good).
  2. Comment out the following 2 lines in the + (void)customizeButtonWithPrimaryColor:(UIColor *)primaryColor withContentStyle:(UIContentStyle)contentStyle; method inside Chameleon_.m:
[[UIButton appearance] setTintColor:contentColor];
[[UIButton appearance] setBackgroundColor:primaryColor];

The only problem is that you'll have to handle the appearance of most UIButtons yourself. Good luck!

@skytoup
Copy link
Author

skytoup commented Nov 26, 2015

Thank~

@vicc
Copy link
Owner

vicc commented Nov 26, 2015

@skytoup No worries! 😃

adozenlines added a commit to adozenlines/Chameleon that referenced this issue Dec 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants