apple Watch: remove status bar for Interface Controller - apple-watch

Is it possible to remove status bar for a particular Interface Controller or customise Interface controller title text in any way ?

As of Apple Watch Programming Guide you can customize interface controller title text color by setting your App’s Key Color.
Every WatchKit app has an associated key color, which is applied to the >following UI elements:
-The title string in the status bar
-The app name in short look notifications
An app’s key color is stored in the Global Tint property of the app’s storyboard. To access this property, select your storyboard and display the File inspector. Select one of several preexisting colors from the popup menu or use the color picker to specify a custom color.
This is all we have as of today.
About if it is possible to hide the status bar...
The closer result you will get is by using modal interfaces.
In this ones, the clock will be invisible but the status bar will remain there holding the interface title.

Related

Detect when a NSStatusItem has been removed via drag and drop

One can set a NSStatusItem's behaviour property to removalAllowed (NSStatusItemBehaviorRemovalAllowed)
Then a user can remove the item from the status bar using drag and drop.
Example: removing the WiFi status item from the status bar
However, I am unable to detect when the statusbar is being removed so I can remember it and not show it the next time the user starts the app. There is no delegate or notification and the statusBar property is readonly so I can't override the setter.
Any idea? :)
The documentation for NSStatusItemBehaviorRemovalAllowed says:
Upon removal, the item’s visible property changes to NO. This change is observable using key-value observation.
So you could add a KVO observer for that property, and if it changes to NO (and assuming you didn't set it to NO), don't show your status bar item on future launches.
That said, in testing this out: the system handles this for you fairly well. When you create your status bar item, don't set the visible property, and set an autosaveName. If the user removes your item from the status bar, the system writes that to the app's preferences in ~/Library/Preferences, and your status bar item won't be visible on future launches.
To restore the visibility, manually set the visible property to YES.

How to handle sub-content in tabGroups in Titanium Mobile

What is the designated way to handle alternating content in the active tab of a tabGroup?
In my case I have a tableview with a toolbar on top, and when a row is clicked, I'd like to switch the content in that tab to a new content with a different (edit) toolbar.
In the KitchenSink demo app the window is just replaced as far as I can see. Is this the way to go? How are transitions handled?
Thank you for your answers,
Chris
You can open the new window on the current tab:
tab.open(newWindow);
This will use the standard iOS navigation transition animation.
Also, you can configure a window's navigation bar (top bar) without needing to create and add a toolbar using Window properties like title, leftNavButton, rightNavButton. For example, create an edit button and then do:
newWindow.rightNavButton = editButton;
Also, you can create a standard edit button by setting the systemButton property to Ti.UI.iPhone.SystemButton.EDIT.
Finally, to create a system button with any title, set title property and also set the style property to Ti.UI.iPhone.SystemButtonStyle.BORDERED.

position of UITabbar

I try to place UITabbar on iPhone window using CGRectMake.
But I found that the Y position is different from the display in Interface Builder.
Is there anyone met the same problem?
Using CGRectMake to locate the x,y position, is it possible cause the refusing from App stoe due to compatible reason?
Thanks
interdev
If your tab bar is associated with a tab bar controller it may not be moved in code. From Apple's documentation:
"Important: In iPhone OS 3.0 and later, you should not attempt to use the methods and properties of this class to modify the tab bar when it is associated with a tab bar controller object. Modifying the tab bar in this way results in the throwing of an exception. Instead, any modifications to the tab bar or its items should occur through the tab bar controller interface. You may still directly modify a tab bar object that is not associated with a tab bar controller."
http://developer.apple.com/iphone/library/documentation/uikit/reference/UITabBar_Class/Reference/Reference.html

Custom uitoolbar gets partly hidden

I'd like to add a custom UIToolbar to my UIViewController. In Interface Builder I add the uitoolbar at the top of my view, and it looks just fine. However, when I run the app in the Simulator it gets hidden by the default iphone bar (this one with the clock, battery status, etc.).
Here you can see how it looks like:
example http://www.cs.put.poznan.pl/jjurkiewicz/private/uitoolbar_hidden.png
Any ideas?
Seems like you're adding your view at coordinates (0,0), the top left of the screen. The view is then getting drawn behind the status bar. Make sure to add the view in the right position, to place it below the status bar it should be at (0,20)
You shouldn't hide the status bar needlessly - so use the IB inspector on the window/view, and under "Simulated Interface Elements", set status bar to anything bar "None". This should be how a new view is created in IB.
You can always just hide your status bar with the "Status bar is initially hidden" property in your Info.plist

UITabBarController tagging Tabs?

I have an app that uses various view controllers as tabs. I'm in the process of saving the custom tab order when the app shuts down. I'm trying to find a generic identifier for my various view controllers without having to add an attribute to each controller (which my backup plan).
I would think, similar to UILabels, that maybe view controllers would support tagging or something similar? I'm having trouble finding in documentation so is there a way to tag or otherwise uniquely identify each view controllers in my UITabBarController?
How has nobody suggested the correct answer so far? When creating your tab bar items, use the tag property of the tab. It's easily accessible in Interface Builder as well.
- (id)initWithTitle:(NSString *)title image:(UIImage *)image
tag:(NSInteger)tag Parameters
title
The item's title. If nil, a title is not displayed.
image
The item's image. If nil, an image is not displayed.
The images displayed on the tab bar are derived from this image. If this image is too large to fit on the tab bar, it is scaled to fit. The size of an tab bar image is typically 30 x 30 points. The alpha values in the source image are used to create the unselected and selected images—opaque values are ignored.
tag
The receiver's tag, an integer that you can use to identify bar item objects in your application.
I'm pretty sure you'll have to just go with your backup plan. There are advantages to that, anyway, because it gives you more control over the whole process and how you'd like to save and differentiate between your tabs.
It shouldn't be much work to quickly subclass UITabBarController and add a string/int to identify the items.