I've seen this SO question here: Can I tint (black) a UIKeyboard? If so, how?, where the top answer suggests that you can hack around but doing so may get your app rejected by Apple. This must not be true, as I've seen other iPhone applications (a major one being Clear) that have a black UIKeyboard. How is it done?
Here's a screenshot of Clear for reference:
Try this out
[(UITextField *)mySubView setKeyboardAppearance:UIKeyboardAppearanceAlert];
or just adding setKeyboardAppearance:UIKeyboardAppearanceAlert appropriately depending on how you have this set up!
Isnt this the [textView setKeyboardAppearance:UIKeyboardAppearanceAlert]; style?
Otherwise, as stated. It's not possible without hacking the subviews. Of course you can still setup your own complete inputView.
Starting in iOS 7, you can use UIKeyboardAppearanceDark
So, for example:
self.textField.keyboardAppearance = UIKeyboardAppearanceDark
Related
I would like to change the tint color of my UIActionSheet for my iOS apps. Is there an easy answer or custom class which I can use to achieve this?
I have found help on changing the colors of the Action Sheet buttons which is helpful, but I haven't found anything about changing the background color.
There is no API, but you could subclass UIActionSheet and play around with its subviews array till you find the one that draws the background and either edit it directly, or add a subview to cover it up.
While this isn't the greatest approach, it isn't using any hidden APIs to it won't get rejected from the iTunes store. Before iOS 5, this is how most customization was done.
Here is a great example of doing it with Navbars.
I am not able to respond to the above comments. However the link provided by #Luke is broken, but I have found it to be active here: https://github.com/gpambrozio/BlockAlertsAnd-ActionSheets
There is no legal API for this, and if you use illegal API your app will be rejected from the app store. The simplest solution is to roll your own interface and not use UIActionSheet.
I'm aware that this question has been asked before for earlier versions of iOS, however, as far as I remember, people at the WWDC this year emphasised that we can finally customise everything very easily, e.g. the tint colours of switches (UISwitch onTintColor etc.).
I had a look at the AlertView but the only options are password input / text input. Perhaps I'm missing something obvious here, but is it still not possible to change the background tint colour of an UIAlertView in iOS 5 easily? All the other UIAlertViews in iOS are blackish/transparent, so there should be an easy way or not?
I checked the docs but couldn't find anything specific for iOS 5.
I have no idea if the background color can be changed that easily in iOS5 but traditionally speaking changing UIAlertView background is to do with setting a new image. The link you provided & this link provide help.
I have a view with a segmentedcontrol in it and I would like to set the background image of that control. I know that I can change set the tint color, but I want more control over it than that. So if I could set a background image that would be cool.
I found this tutorial on how to achieve this, however it's outdated, and I'm unable to get it working.
Could anyone please help me? I greatly appreciate any help.
UPDATE
Half the solution has been found, if the only thing one needs to support is iOS5 you can use setBackgroundImage:forState:barMetrics:. A great tutorial on the matter can be found here.
How about this?: setBackgroundImage:forState:barMetrics:
Straight from the docs
Note: Available in iOS 5.0 and later.
Xcode4 introduced the gray-rounded-square style non-modal alerts that momentarily appear as required. For an example, see 'Build Succeeded'. iirc, this style of non-modal alert is also used elsewhere in Lion.
Now, also iirc, I believe I saw some official iPhone sample code showing how they recommend this effect is achieved in iPhone Apps, but I can't find it again. I'd like to use in my App this to achieve a consistent style.
If someone recalls what I'm talking about, I'd appreciate a link. Thanks.
I think you're talking about the bezel notification style? On iOS, I know SSToolkit has support for such a display (under HUD View).
Another way: This uses MBProgressHUD and provides sample code.
I think you can do it using a momentary UIActivityIndicator. Something like this
EDIT: or this
EDIT: The idea is the same, a custom activity indicator. The above answer gives you some more specific links to your problem. But well it is an activity indicator you're looking for.
I have iOS 4.3 installed on my iPad. I'm noticing that my text in my UILabels is not resizing. In other words, I'm adding letters, but it's just truncating. Same settings work find on iPhone also running 4.3. I'm perplexed. I've made certain that "Adjust to fit" is checked on the label properties. I've even set it in the code with .adjustsFontSizeToFitWidth and even tried calling sizeToFit.
None of these let the text resize.
Does anyone else have this problem?
Any ideas?
My next solution is going to use this: Check if label is truncated to try and manually resize the label text.
I finally figured it out. I'm using OHAttributedLabel. I had intended to do some things with color in my labels and have not yet gotten around to it. It finally dawned on me that was the only difference from previous iPad versions and from the iPhone version (I never even thought to look at the class). Turns out this OHAttributedLabel class does not support resizing yet.
Sorry for wasting everyones time. Maybe someone else will someday find this useful.
Try using CGSize eLabelSize = [yourLabel.text sizeWithFont:yourLabel.font]; to get the size of the label and then you can simply modify the yourLabel.frame.size property with eLabelSize.
This worked for me in case of iPhone.
Hope this works for you if yes do communicate..... :)
Maybe it only appears as if the label is truncating text because the label frame runs out of the bounds of its parent view, which clips to its bounds? Verify the frame of the label and the autoresizing mask.
Also, the minimumFontSize property is set low enough?