Since Xcode update to 9 the status bar stay with white background if I hide the navigation bar:
navigationController?.setNavigationBarHidden(true, animated: false)
Before, it kept the color of the navigation bar.
The only solution was to create a new status bar:
let statusBarView = UIView(frame: UIApplication.shared.statusBarFrame)
let statusBarColor = Constants.Colors.Blue
statusBarView.backgroundColor = statusBarColor
view.addSubview(statusBarView)
Why it works like this now? It is a bug?
I just got the same issue.
You have to disable "Adjust Scroll View Insets" for your ViewController in the Storyboard/XIB, that's all !
Related
While swiping a form, the growing left part of the screen is just white until the swiping is done, when the "back-to" form finally is painted. Is this by design? I expected the "back-to" form either to be gradually revealed, or to slide in from the left.
On iOS and Android, the form being swiped also seems to turn white, so the whole screen is white until the swiping is over. This is not the case with the simulator, however, where you can see the form until it's swiped all the way out.
Code to reproduce the behaviour:
Form redForm = new Form("Red Form");
redForm.getAllStyles().setBgColor(0xff0000);
Button btnToBlueForm = new Button("Go to blue form");
redForm.add(btnToBlueForm);
Form blueForm = new Form("Blue Form");
blueForm.getAllStyles().setBgColor(0x0000ff);
LazyValue<Form> lazyRedForm = (Object... args) -> redForm;
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
btnToBlueForm.addActionListener((ActionListener<ActionEvent>) (ActionEvent evt) -> {
blueForm.show();
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
});
redForm.show();
Press the button in the red form. The blue form now appears. Swipe back and observe the effects.
That's because of the SlideFade mode in the transition. If you switch it to Slide it should work as expected with the background. Here's a version of your code that works as you would expect by applying the style to the content pane:
Form redForm = new Form("Red Form");
redForm.getContentPane().getAllStyles().setBgColor(0xff0000);
redForm.getContentPane().getAllStyles().setBgTransparency(255);
Button btnToBlueForm = new Button("Go to blue form");
redForm.add(btnToBlueForm);
Form blueForm = new Form("Blue Form");
blueForm.getContentPane().getAllStyles().setBgColor(0x0000ff);
blueForm.getContentPane().getAllStyles().setBgTransparency(255);
LazyValue<Form> lazyRedForm = (Object... args) -> redForm;
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
btnToBlueForm.addActionListener((ActionListener<ActionEvent>) (ActionEvent evt) -> {
blueForm.show();
SwipeBackSupport.bindBack(blueForm, lazyRedForm);
});
redForm.show();
The reason this works as opposed to the original code is that SlideFade is two separate transitions one moving/fading the title and the other sliding the content pane alone. Since the content pane is transparent the background isn't painted as we assume it's the form background. By setting the content pane color/opacity we get the exact same effect at a layer the SlideFade will "see".
The iOS Disclosure Indicator changed appearance in ios7; it's now a faded grey.
Unfortunately, my app has a lot of pages (more than 100) with different sections and background colors. On ios6, there is no problem, but on ios7 the new disclosure indicator is not visible on the background of some sections.
I need a solution, because I don't have the time to change more than 100 page background, and even if I did, if the color disclosure indicator looks okay in ios7, it's not in ios6, and vice-versa.
Set the tintColor of the table view. This will color the disclosure indicator on the cells.
Note that the tintColor property is only available under iOS 7 so code it properly:
if ([self.tableView respondsToSelector:#selector(setTintColor:)]) {
self.tableView.tintColor = ... // the desired color
}
Will it be possible for you to create custom images for ios7, and set the accessoryView of the problem cells in a method such as the data source 'cellForRowAtIndexPath' like below?
if(UIDevice.currentDevice.systemVersion.floatValue >= 7)
{
UIImageView* customDisclosureImageView = [[UIImageView alloc] initWithImage:normalImage];
customDisclosureImageView.highlightedImage = selectedImage;
cell.accessoryView = customDisclosureImageView;
}
Is there any way to make navigation bar elements (back button) in iOS 6 look like navigation bar elements in iOS 7 ?
And also buttons and other iOS 7 elements of UI.
Instead of putting code into every view controller that you need to customize, I would recommend doing this for the entire application by putting something like this in your application:didFinishLaunchingWithOptions: method in the App Delegate
// Nav bar
[[UINavigationBar appearance] setBackgroundImage:[[UIImage imageNamed:#"navBar.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 5, 10, 5)] forBarMetrics:UIBarMetricsDefault];
// Back buttons
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:#"backNavButton.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
// Toolbar
[[UIToolbar appearance] setBackgroundImage:[[UIImage imageNamed:#"toolbar.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 5, 10, 5)] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
You can customize the navigation bar by setting the background Image like this
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:#"topbar.png"] forBarMetrics:UIBarMetricsDefault];
And you can add a customize bar with setLeftBarButtonItems method like this.
[self.navigationItem setLeftBarButtonItems:];
There is a problem with the title bar on iOS7: the iOS7 toolbar overlaps the title bar and its buttons. The buttons are tapeable, but barely. I'm seeing this on the app I created, which is packaged as a native app using PhoneGap.
I'm sure the people at Sencha will fix it in a later version, but what's the best fix in the meantime? The so-so solution seems to be to use CSSĀ to push the content of the title bar down.
Thanks for any more graceful solution.
I found the solution (hack) in this page
basically you just have to compare if the iOS version is bigger equals than 7 and if it does, increment the height of the toolbar.
Here is the code:
app.js
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('StromRechner.view.Viewport'));
// Adjust toolbar height when running in iOS to fit with new iOS 7 style
if (Ext.os.is.iOS && Ext.os.version.major >= 7) {
Ext.select(".x-toolbar").applyStyles("height: 62px; padding-top: 15px;");
}
},
I want to get screenshot of screen under my form, so I hide it first and show after capturing. But on my Windows 7 form is not completely minimize, so I get form on screenshot. How can I be sure that my form is competely minimize?
WindowState = FormWindowState.Minimized;
Bitmap screenshot = ScreenUtils.ScreenShot();
background = screenshot;
WindowState = FormWindowState.Normal;
P.S. Hide() and Show() have the same problem.
you could set your forms opacity to 0, call refresh to make sure the painting is done, capture, reset opacity to 1 and call refresh again
Did you try to build in a sleep before making a screenshot?