I want to create a tweak to add a text to the status bar. The text will be appended to the time label. So what is the the hooked class and method.
You cannot hook a status bar.
You can just change its style and hidden properties.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/index.html#//apple_ref/c/tdef/UIStatusBarStyle
Related
Is there a way to make chosen Tab Bar Item look disabled programmatically?
I have Tab Bar, almost everywhere its Items look active (it is delete, edit, search buttons). But on some pages some of its Items has to be inactive, showing user that he can't edit/delete anything here. I'm thinking, is there a way to change the visual appearance of chosen Tab Bar Item? Or better to use just set of the Buttons?
all active items/buttons in a bar, screenshot
all active items/buttons in the bar, screenshot
UPD: Desigion for disabling Item found, but when I make the Item disabled, I need to change its colour. Now it has the same color as UITabBar.appearance().unselectedItemTintColor but with transparency. Is there a way to change color and transparency for disabled Item (make it coloured differently and not transparent), keeping the colour for unselected Items?
For required tabbar item try to set false for .enabled property.
Obj-C
.enabled = NO;
Swift
.isEnabled = false
Alternatively, you could make your tabBar dynamic and instead of disabling/enabling, only show the relevant items. This way, the items are always nicely displayed and you don't have any gaps as you have in your screenshot.
Is there a way to change the content in UITabBar item dynamically, as it is illustrated in the image. Idea is to indicate the user there are new content he/she hasn't seen.
You can set a numbered badge using UITabBarItem.badgeValue, but its look won't be configurable.
in my ios app i have a tabbar containing a lot of button. Some of them are after the "More" button. There's a way to change the text of the "more" button to "altro" that is "more" in my language?
the properties title and image of a UITabBarItem provided by the system can not be changed, as the documentation says:
Discussion
This method returns a system-supplied tab bar item. The title and image properties of the returned item cannot be changed later.
This value be will automatically localized to the correct language by the operating system. If you need to change this you will have to create the item, and its functionality, by yourself.
As shown on Apple's September 2012 keynote, the status bar tint color varies between apps in iOS 6. For instance, Safari and Maps use a black status bar whereas Mail adds a blue tint to it.
Is it possible to set that tint color, or at least force it to black?
You can do it from the plist like Comradsky mention or in xcode 4.5, they added an option for it in the project summary.
Update:
several people were confused by this answer. Just to clarify, you cannot set the status bar tint to any color you want. What is described above is only to change the status bar tint during launch and choose the iOS 6 default status bar color behavior (which picks the color of the bottom row of pixels from your navigation bar).
I've just found how to do it !
In your "Project Summary", in "Status Bar", set "Style" and "Tinting" to "Default.
Then, jump into you xib or storyboard and add a UINavigationBar just below the status bar.
Set the UINavigationBar "Style" to "Default" and select the "Tinting" of your choice.
Run! :-)
If, like me, you don't want any UINavigationBar visible in your Interface, all you want to do is putting the UINavigationBar behind all the Objects, or set the "Alpha" to zero.
You can do that in a tricky way..
In the Project Summary select Status Bar Style Black Transculent from the drop down menu.
In application: didFinishLaunchingWithOptions: enter the following line of code:
self.window.backgroundColor = [UIColor greenColor]; //example color
It works fine for me.
The tint color seems to be determined by the average color of the bottom pixel row of the app's header bar.
See here:
http://www.cultofmac.com/173928/how-ios-6s-cool-new-adaptive-status-bar-works/
It is very easy to do:
just put up an UINavigationBar in your .xib/storyboard, make sure the style is default.
then add a tint. no matter how many views, with different tinted UINavigationBar's, you have your status bar will change its color.
There is no way in iOS 5. You can just change your bar style.
In iOS 6 you can do it in the info.plist:
It is now possible to set status bar tint parameters in your app’s
Info.plist file. You might do this to ensure that the status bar color
matches the navigation bar color of your app during startup. To set
the status bar tint, add the UIStatusBarTintParameters key to your
Info.plist file. The value of this key is a dictionary with the
appropriate values describing the navigation bar your app has at
startup time. Inside the dictionary should be the UINavigationBar key,
whose value is also a dictionary. That dictionary contains the initial
navigation bar’s style (with the Style key) and whether it’s
translucent (with the Translucent key). If your navigation bar uses
them, you can also specify its tint color (with the TintColor key), or
the name of its custom background image (with the BackgroundImage
key).
Check out this link here
Edit:You can also do this in the project summary.
In the contacts app, the search bar is shown with a white background and it blends in well with the surrounding UI. The only style choices in Interface Builder don't seem to show a way to host just the search bar, but instead includes chrome around it to make it look slightly 3d.
Is there a way to get rid of the surrounding chrome and simply have the search bar overlaid on my own view's background (which happens to be flat black)?
You could use the UIBarStyleBlack .barStyle, or set the .tintColor to black, or set the .translucent to YES.
However, there's no documented way to change the background image of a search bar.
You may use a UITextField with a custom .background and .leftView to simulate the look of a UISearchBar.