How to change statusbar color - shell

I'm creating an app using Xamarin.Forms Shell, but I can't change the statusbar... I managed to change the color of the activebar but the statusbar remains dark blue.(In an Android Device with Android 9.0 Pie)
I googled if there's a way to change the color of the status bar, but what I found didn't take effect... so I wonder if in Xamarin.Forms Shell there is a way to change it. otherwise, is there a way in Xamarin.Forms?(without using the shell).
P.S. On https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/configuration
I see that the iphone has the colored top bar and the device with Android has the status of the black bar, so if one day I will have to use the app in an iphone, does it mean that I will not have this problem? (I assume this also depends on the version of the operating system)
I'd like to read your experience, in the meantime thank you.

Please Add
Window.SetStatusBarColor(Android.Graphics.Color.Argb(255, 0, 255, 0)); this line in your OnCreate() method of android platform.
I change the status bar to green. There is running screenshot.

Related

Xamarin Forms - physical keyboard dims page when no input control is present

My actual application is using a bluetooth scanner in HID mode and capturing the input on the DispatchKeyEvent of the MainActivity. It works great except that the screens dims to some dark opaque color where it looks like everything is disabled and you have to navigate back to a page with an input control and tap on it to get the screen to go back to normal.
It's not as noticeable in the stock template but in my actual application (Screen shots at bottom) the dimming is very noticeable; it's a blue-gray opaque overlay that really stands out. I have no idea why it's like that. I'd almost just be happy if my actual app dimmed like the default forms sample.
Steps:
Make a Xamarin Forms app from one of the templates.
Change nothing.
Run simulator.
Press a button on your keyboard.
Result:
The screen dims and the soft keyboard does not popup.
Next Steps:
Add an Entry control. < Entry/> will do.
Click on it and the screen brightens back up.
Delete < Entry/>
Press a key on your keyboard and the soft keyboard pops up and the screen doesn't dim again.
What I want:
To know where the dim/overlay color/opacity is set so I can change it.
To not allow the soft keyboard to try and popup at all unless there's an entry field that has focus.
Here's screenshots from the default forms app:
Not Dim:
Dimmed after pressing the keyboard:
My actual test device is a Samsung Galaxy XCover Pro running Android 10.0. I'm working on porting a native Xamarin Android app to Forms so we can run it on iOS as well. I never had this issue with my android app and I'm not sure how to track down what's happening.
Here's a before pic. I've got an Entry field focused.
After scanning a barcode with my bluetooth scanner this happens:
There is NOT any overlay/modal boxview defined in the XAML. The overlay is nothing that I added. Though I seem to have done something to influence the color; I don't see anything in my styles.xml files that would change the color from the default light gray (as shown in the sample Xamrin Forms template).
I can reproduce this with a scanner on the "Welcome to Xamaring Forms!" as well, the screenshots don't really show the change in overlay color; its much more subtle; I really would like to know why in my app the overlay is so much more obvious.
I'm still annoyed it happens at all. But just in case anyone else using a
hardware keyboard as input (or a BT scanner connected as a HID) and you thought you'd be fancy and override one of the default styles and use a pretty green accent color like this: (though stupidOverlayColor has been changed to pink just to make sure I found the issue) - don't do it.
<!-- Base theme applied regardless of API level -->
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorControlHighlight">#color/stupidOverlayColor</item>
</style>
The moral of the story is that "colorControlHighlight" is evil and not to be overridden and used with hardware keyboards, unless you want your app to think the entire screen should get the highlight color after you scan a barcode like this:

How can you modify the styling of a compiled macOS app without the Xcode project and without additional apps?

Does anybody know, how to change the appearance of the title bar and/or toolbar of a simple & small one-window cocoa macOS application without accessing the Xcode or installing third party applications? It's for a screen recording video project, I want to do.
I know, that there are possibilities within the applications info.plist (for example changing the app title inside the top macOS Menu Bar) but I would like to be able to change the apps window title itself and/or colors and/or fonts inside the window title bar or toolbar if possible.
Opening the app in another container window or via terminal or Applescript and adding custom parameters or even an overlay in the right position to change the styling would be okay if this is possible?
Can somebody point me in the right direction?
Thank you very much!
in short: Nibs
Nib File Viewer works until Xcode 10
saving, recompiling if possible
good luck

Change iOS status bar text color while dark mode is activated

With iOS 13 new dark mode feature, it now seems impossible for me to control the status bar text color in Xamarin Forms. Most of the solutions I find seem to be from before dark mode was introduced to iOS.
My application uses resources so that I can easily change the style of the whole app. Even in dark mode, the color of my navigation bar is not pleasant to read with white text. I need to set the color of the status bar to black, no matter what color mode the device has activated.
I've tried to set the colors manually in my navigation page, but it seems to be overriden by iOS color mode. This code works on Android:
BarTextColor = Color.Black;
BarBackgroundColor = (Color)App.Instance.Resources["PrimaryColor"];
I've tried setting true and false to UIViewControllerBasedStatusBarAppearance.
I've also tried all settings of Status Bar Style in Info.plist.
Does anyone know of a way to control this in Xamarin Forms since the release of Dark Mode?
Did you check this docs? NavigationPage Bar Translucency on iOS NavigationPage Bar Text Color Mode on iOS . Maybe translucency can solve your problem?
The problem was fixed by switching to Xamarin iOS SDK 13, it adds an item to the StatusBarStyle enumeration.
More info here.

Change color of selected NSTabView Tab for OS X App

I'm working on an OS X application with Xcode and swift, and I am trying to get the color of the clicked NSTabView to change from it's default blue color. I can't seem to find much information on this, and when I do it is really old. It seems like it is much easier to make changes with iOS, but I specifically need changes on my OS X App in Swift.
Can you not do it within Interface Builder?
I have done that by changing the colour of window where I am switching from one tab to other.
[windowMain setBackgroundColor:[NSColor grayColor]];
or any colour.

On MacOS with Qt5.3.1 QToolBar is black when attached

I have a QMainWindow Application that uses several QToolBars. My program works on Linux, Windows and MacOS, however on MacOs the QToolbar behaves a little bit funky. When attached to the MainWindow it is just black as shown here
When I detach it it is grey as you would expect it to be
Also when I maximize to program the toolbar creates artifacts like this
Do I need any MacOS specific things for the QToolBar?
I'm hitting this bug too. I think it is linked to using non-alien widgets inside the toolbar or app wide.
Are you using setAttribute(Qt::AA_NativeWindows);? If so, try removing it.
Would you happen to have a QGLWidget-based UI element in your application? If so, apparently this is a known issue.
https://bugreports.qt.io/browse/QTBUG-41679
I am experiencing the "double-vision" aspect of this on a Qt 5.7.0-based app.

Resources