How can i make a webView in NativeScript fullscreen including the statusbar. Not hide the statusbar only but the webview behind the statusbar like do this cordova.
And how can i prevent the webview of scrolling/bouncing
Thank you
UPDATE:
What i mean with the statusbar/fullscreen and cordova is in cordova is the statusbar transparent and the web view fullscreen.
and the other question is about the bouncing, in cordova can i prevent the webview from bouncing with this in the config.xml
<preference name="webviewbounce" value="false" />
Update:
The solution for the bounce is this:
var webView = page.getViewById('webView');
webView.ios.scrollView.bounces = false
How can make the statusbar transparent?
The solution was on the end.
ios:
put this in the plist file to make the statusbar "transparent"
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
create a ios only file with this content to but the webview under the status bar
#webView{
margin-top: -20;
}
and add this to the page loaded function to prevent the webview of bouncing
if(page.ios){
webView.ios.scrollView.bounces = false
}
android:
is much simpler but this in the page wrapper of the webview to hide the titlebar
actionBarHidden="true"
i hope this helps anyone
I'm not following your question in regards to the statusbar and Cordova. However for the bouncing, the simplest option is to use this plugin which already has the native code for both iOS/android to remove the scroll bounce. See here: https://github.com/TheOriginalJosh/nativescript-swiss-army-knife#common-functions
If you can expand a bit more about what you want to do with the statusbar I can help there. I have a blog post detailing the android statusbar and navigation bar and a few things you can do natively with it in a few lines of code. https://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/
Related
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.
I have a web view to show the browser url image. "My Question is" How to change webview background black colour to white colour in xamarin forms. Please give the solution to resolve this issue
Webview has a BackgroundColor property. Set it to White.
<WebView BackgroundColor="White"/>
I think you could need to use custom render to change webview background.
Here is the same thread, you can take a look:
Adding background color to Xamarin Forms WebView has no impact
I'm trying to find a way to put a close ToolBarItem on the left of my ToolBar.
To be more explicit, here are some screenshots:
For Android:
For iOS:
The problem is not about to display icon istead of text, I'm using Iconize for that. The problem is about to put ToolBarItem to the left for both iOS and Android.
I've found this renderer for iOS (not tried yet):
https://gist.github.com/alexlau811/f1fff9e726333e6b4a2f
You need to write Custom renderer to implement left side tool bar items. Detailed implementation for this is explained here https://timeyoutake.it/2016/01/02/creating-a-left-toolbaritem-in-xamarin-forms/
Hi I am building a magazine viewer and I need to zoom and drag the content pages. I am using scrollview but I guess the zoom works only for ios. Is there any workaround for this? I am using Titanium 5 sdk, and don't found modules that support it.
On Android you might be able to use http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ImageView-property-enableZoomControls
I have create a new view in order to be sure the opacity is not applied for some resource in my app, but for some reason it is not working in a clean enviroment neither.
I have checked the XF documentation and the modal with all the items should render in a solid color.
I have found the emulator was rendering a wrong modal for the picker, maybe it is caused by the default theme on the emulator. I have tested the app on a real device and seems to be ok.