0

I am trying to implement a custom appearance for UIView when contained in UIViewController.

var viewStyle = UIView.AppearanceWhenContainedIn(typeof(UIViewController));
viewStyle.BackgroundColor = UIColor.Blue;

The result I get from doing this is something ugly, like this: messedUpView

I tried adding code to change the UITextField/UIButton background by doing:

var txtBoxStyle = UITextField.AppearanceWhenContainedIn(typeof(UIViewController));
txtBoxStyle.BackgroundColor = UIColor.White;

var btnStyle = UIButton.AppearanceWhenContainedIn(typeof(UIViewController));
btnStyle.SetTitleShadowColor(UIColor.White, UIControlState.Normal);
btnStyle.SetTitleColor(UIColor.Black, UIControlState.Normal);

but that doesn't help my result at all (the above image isn't updated from when I changed the button title color from white to black, you'll have to imagine the button's text as black instead of white). Anyone know how to get rid of that ugly blue in the (foreground or background?) of the UITextFields and UIButtons? Bonus if you can figure out why the Title's background is blue as well and how to fix that!

4

0 回答 0