tintcolor

How to change tintColor of whole app? SwiftUI

自闭症网瘾萝莉.ら 提交于 2020-03-20 05:58:32
问题 So, I am supporting three themes in my app, each with different tintColors. I'm using @EnvironmetObject to track changes. However, I can't use it on SceneDelegate.swift file, because the app crashes. Moreover, accentColor is not an option, as it doesn't change alert tintColor. How can I do it? Here's some code: SceneDelegate.swift file class SceneDelegate: UIResponder, UIWindowSceneDelegate { @EnvironmentObject var userData: UserData var window: UIWindow? func scene(_ scene: UIScene,

How to change tintColor of image in UIButton with imageEdgeInsets?

倾然丶 夕夏残阳落幕 提交于 2020-01-21 19:14:24
问题 I I have an UIButton in my objective-c application. My button was modified adding text and image like: - (void)centerButtonAndImageWithSpacing:(CGFloat)spacing { CGFloat insetAmount = spacing / 2.0; self.imageEdgeInsets = UIEdgeInsetsMake(0, -insetAmount, 0, insetAmount); self.titleEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, -insetAmount); self.contentEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, insetAmount); } And then I add the image with this code: [self.myButton setImage:[UIImage

How to change tintColor of image in UIButton with imageEdgeInsets?

人盡茶涼 提交于 2020-01-21 19:14:05
问题 I I have an UIButton in my objective-c application. My button was modified adding text and image like: - (void)centerButtonAndImageWithSpacing:(CGFloat)spacing { CGFloat insetAmount = spacing / 2.0; self.imageEdgeInsets = UIEdgeInsetsMake(0, -insetAmount, 0, insetAmount); self.titleEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, -insetAmount); self.contentEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, insetAmount); } And then I add the image with this code: [self.myButton setImage:[UIImage

UISegmented Control - setting the tint color of each segment

妖精的绣舞 提交于 2020-01-13 19:10:55
问题 I have been wanting to apply different colors to my UISegmentedControl segments. Many people on here have been asking how to set tint color when you press on a certain segment. What i want to do is to set the tint color of each segment throughout the life of the application(or when the view appears on the screen). Scanning the questions on here, different people have pointed out that evidently in iOS 6 you cannot set the tintColor of each segment as such: - (void)viewDidLoad { [super

UISegmented Control - setting the tint color of each segment

白昼怎懂夜的黑 提交于 2020-01-13 19:08:11
问题 I have been wanting to apply different colors to my UISegmentedControl segments. Many people on here have been asking how to set tint color when you press on a certain segment. What i want to do is to set the tint color of each segment throughout the life of the application(or when the view appears on the screen). Scanning the questions on here, different people have pointed out that evidently in iOS 6 you cannot set the tintColor of each segment as such: - (void)viewDidLoad { [super

Make custom image respect tintColor property iOS

ぃ、小莉子 提交于 2020-01-12 17:41:09
问题 I have to imagine this has been asked several times, but I must not be wording my question correctly. I have my own custom image I made in photoshop and it is set as a button's image property. Here it is showing normally: The background is transparent, but it is 44x44 with the three dots being a 88x88 pixel .png file. So if I do something like this: self.theButton.tintColor = [UIColor redColor]; the image still shows as white. I am not a designer by trade, so I seem to be missing how to

UIsegmentedControl setTintColor strange behaviour

南楼画角 提交于 2020-01-06 04:33:15
问题 I have a UISegmentedControl containing 3 options for selecting map type. I am setting tintcolor as black as default and I want to set green color for selected segment. Here is declaration of segmented control NSArray *mapType = [NSArray arrayWithObjects: @"Map", @"Hyb", @"Sat", nil]; segmentedMapType = [[UISegmentedControl alloc] initWithItems:mapType] ; segmentedMapType.segmentedControlStyle = UISegmentedControlStyleBar ; segmentedMapType.tintColor = [UIColor blackColor]; segmentedMapType

Set NavigationBar Tint Color in iOS 7

大兔子大兔子 提交于 2020-01-03 02:31:12
问题 Am trying to set the tint for all navigation bars from my appdelegate in iOS 7. This worked always before, but for some reason now, nothing is changing. In the didFinishLaunching part of my appDelegate I have: [[UINavigationBar appearance] setTintColor:toolbarcolor]; However, the bar stays the default translucent option. 回答1: You can set the bar tint color using the barTintColor property: [[UINavigationBar appearance] setBarTintColor:[UIColor purpleColor]]; If you also don't want the

UINavigationBar set tintcolor tested in iOS7 not working?

房东的猫 提交于 2020-01-01 01:15:54
问题 I have an app which have a UINavigationBar and I have set the tint color to black like this: self.navigationController.navigationBar.tintColor = [UIColor blackColor];` I have tested it in IOS 6 and it's black. However, it appears as the default navigation bar when I tried the same app in iOS 7. As the title says, is it not working? 回答1: You need to set the barTintColor property. You can specify a custom tint color for the navigation bar background using the Tint (barTintColor) field. The

iOS7 UILabel to adopt same tintColor as window

百般思念 提交于 2019-12-31 10:40:54
问题 I know that for elements of classes UIButton and UIBarButtonItem they automatically assume window.tintColor as the main colour, which results of an immediate change in case I set a new tintColor to window at any time in the app. I was wondering if there is any way to make UILabel elements to follow the same pattern, where once created they automatically assumer its default colour as window.tintColor and if changing window.tintColor at any time within my app runtime would also result in