How to change the color of the UIScrollView indicator?

When I use its changing, but when I try to apply RGB, its not reflected in scrollview indicator. func scrollViewDidScroll(_ scrollView: UIScrollView) { let verticalIndicator: UIImageView = (scrollView.subviews[(scrollView.subviews.count

Create an array of UIColor in swift

Why is this giving me an error? var colorArray = [UIColor.self] colorArray.append(UIColor.redColor()) //error here colorArray.removeLast() how do I define a mutable array to store [email protected] Asda: The error coming up is "Cannot convert value typ

How to get the intermediate color between two UIColors in iOS

If i give two colors UIColor *color1 = [UIColor blackColor]; UIColor *color2 = [UIColor whiteColor]; I should get grayColor as result, how shall I achieve it?A straightforward way of finding the "in between" is to average the four components, li

How to access the Swift UIColor macro

There's a macro in objc file like below. #define kSOME_COLOR [UIColor colorWithRed:100/255.0 green:100/255.0 blue:100/255.0 alpha:1.0] And i wanna access the macro from Swift. self.someView.backgroundColor = kSOME_COLOR But i got compile error Use of

Change the background color of a UIView

First of all I want to inform you that I'm very new to Obj-C programming, so I don't have many experiences. I've got a problem on setting the background color of an UIView. I'm using the following code: self.view.backgroundColor = [UIColor colorWithR

UIColor extension in Swift error

I have this extension: extension UIColor { func rgba(r: Int, g: Int, b: Int, a: Float) -> UIColor { return UIColor(red: r/255, green: g/255, blue: b/255, alpha: a) } } This is giving me an error message: Extra argument 'green' in call I dont get why

Set the color of the tooltip label on a Kendo UI pie chart

I am using a .kendoChart() call to create my self a pie chart. seriesColors: config.colors, tooltip: { visible: true, template: function (e) { return shared.AssetClassName(e.category) + ' ' + shared.toString(e.percentage, "p0"); } } Using series

UIColor does not work with RGBA values

I am trying to change the text colour in a UITextField using the following code (RGBA value) however it just appears white, or clear, I'm not too sure as the background is white itself. passwordTextField.textColor = UIColor(red: CGFloat(202.0), green

Modifying a custom UIView background when selecting

I have three custom circle UIViews which are created. When a user clicks on one of these I would like to change the background Color of the view to be Grey. When the view is originally created, it is a randomColor. I would like this color to stay aro

Setting the hexadecimal background on all views

Hey guys I have the following: - (void)viewDidLoad { [super viewDidLoad]; // SET BACKGROUND OF APPLICATION ON STARTUP [self.view setBackgroundColor: [self colorWithHexString:@"88C800"]]; // Do any additional setup after loading the view, typical

Set a global color

I want to define a global colour that I can reuse for a downstate for various custom ui cells Not sure if this is the correct way to do this but.. I've defined a Class called lightGreyUIColor which has this .h file - #import <UIKit/UIKit.h> @interfa

How to change the color of a UIImage

I want not to change the backgroundColor of an UIImage, but rather to change the color of the whole image. Because I have got standard forms which I can move from popover to the view. In my App it is possible to tinker the images to one big image, i.

hex color of uicolor

i have a problem in converting uicolor to hex color, here what i found CGColorRef colorref = [[Colorview_ backgroundColor] CGColor]; int numComponents = CGColorGetNumberOfComponents(colorref); if (numComponents == 4) { const CGFloat *components = CGC

UITextField border animation

I'm trying to animate UITextField border color (fade in). Here is what I try tmp.layer.borderColor= [UIColor colorWithRed:255.0 green:0.0 blue:0.0 alpha:0.0].CGColor; tmp.layer.borderWidth = 1.0f; [UIView beginAnimations:nil context:nil]; [UIView set

UIButton color change

I want to change UIButton color from brown color to darkbrown color. How i can do that myButton.backgroundColor = [UIColor brownColor]; Any ideas that how to change this brown color to darkbrown color. Thanks for help.If you just want a darker brown

What is wrong with my UIColor code?

I want to make a global UIColor value. In AppDelegate.m I write UIColor *fontcolor; fontcolor = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0]; In MainViewController.m I write extern UIColor *fontcolor; [cell.textLabel setTextColor: fontcolo

Change the color of translucent black UINavigationBar

I stumbled upon this many times, never found a solution. A UINavigationController's navigationBar can be set to black translucent like: self.navigationController.navigationBar.barStyle=UIBarStyleBlackTranslucent; Also, there is a translucent property

Instruments alleges memory leak with [UIColor CGColor]

I am just in the process of tracking down some memory leaks with Instruments. It claims I am leaking in the middle of a drawRect method. Here is the code: - (void)drawRect:(CGRect)rect { if (highColor && lowColor) { // Set the colors for the gradi

RGB to HSL conversion looks OK, but not visually

a noob question here. let's say I have RGB values of: R:53,G:37 and B:11 so i set a background color of a rectangle with: [UIColor colorWithRed:0.53 green:0.37 blue:0.11 alpha:1.00]; now I do a RGB to HSL conversion that yields: H:0.10,is S:0.16 and

setting the background image of UIToolBar in the iphone

I want to set a background image of UIToolbar in my iPhone application. Currently I am setting by using the UIColor's initWithPatternImage:. But it's not doing what I want. Kindly suggest some other solution.Or you can Make custom class and assign it