After new version of nativescript, My page is over lap menu. How to fix its
Fix by app\App_Resources\Android\src\main\res\values-v21\style.xml
coding this on <style name="AppThemeBase21" parent="AppThemeBase">
<item name="android:windowTranslucentStatus">false</item>
Related
I would like to make my app Full-screen on a Vue Project under NativeScript, it sounds easy by #bradwaynemartin method, but there is a problem: my phone has a Notch and it leaves a black strip through the Notch,
how can I remove the strip and make my app totally full-screen?
OS: Android Pie 9
Add this property to application theme:
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
I am trying to make a custom style for a cardview on my activity. It works just as I want to in Android Studio. But when I run it on my device - Galaxy S7 Edge android 7.0 - the cardview attributes are not changing. It uses the background from the style of the layout, and the rest of the attributes - elevation, corner radius and card background seem to be ingnored.
I dont get any errors in the log.
The layout uses style="#style/AddItemStyle"
The card uses style="#style/AddItemStyle.CardView"
Thats the card style
<style name="AddItemStyle.CardView" parent="CardView">
<item name="cardBackgroundColor">#color/card_bg</item>
<item name="cardCornerRadius">15dp</item>
<item name="cardElevation">15dp</item>
</style>
Thats the layout style
<style name="AddItemStyle" parent="Theme.AppCompat">
<item name="colorPrimary">#color/mySecondary</item>
<item name="colorAccent">#color/ColorMain</item>
<item name="editTextColor">#color/ColorMain</item>
<item name="android:background">#color/mySecondary</item>
</style>
In android studio
On my phone
For some reason removing android:theme="#style/AddItemStyle" from the activity in manifest fixed the problem. I don't know why but it worked.
I'm making an app with Xamarin Forms.
Usually the app will have a blue NavBar, but I'm changing the NavBarfor a specific page.
The way I do that is:
InitializeComponent();
var navigationPage = Application.Current.MainPage as NavigationPage;
navigationPage.BarBackgroundColor = Color.FromHex("#99CC07");
But then the statusbar doesn't update it's color:
How can I make it so that the statusbar has the same (shade of) color as the navigationbar?
On iOS it works just fine.
You can modify both colors in the Android project. Go to Resources > values > styles.xml and edit the following values:
<!-- colorPrimary is used for the default action bar background -->
<item name="colorPrimary">#0066A1</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name="colorPrimaryDark">#0E4369</item>
I want to set a navigation bar background image, but so far, no methods worked.
I don't know if I have to override the navigation-page renderer or if I have to change the "styles.xml", or if I have to override the Android "Toolbar", I have tried everything and I can't seem to find the solution.
I am using Xamarin Forms and Master Detail Page navigation.
I already tried changing styles.xml, making a custom toolbar layout, but doesn't mean I have done it right.
<item name="windowNoTitle">true</item>
<!--We will be using the toolbar so no need to show ActionBar-->
<item name="windowActionBar">false</item>
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/