I cannot find a way to customize the height parameter of Shell.TitleView
you could try to add android:actionBarSize to your styles.xml
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
</style>
<!-- Base theme applied no matter what API -->
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
...
<!-- ********* CHECK HERE ********* -->
<item name="android:actionBarSize">80dp</item>
...
</style>
</resources>
I had put the stacklayout below navigationbar with same backgroundColor as Navigationbar. Than put controls in that stacklayout. It seems to user as Navigation bar height is increased.
Related
I want to make the blinking cursor thin in TextInput, how to do that? The normal width is like 3px, I want it to have 1px.
For android you can follow this steps:
step 1: Create editext_cursor.xml and place it under res->drawable directory.
android/app/src/main/res/drawable/editext_cursor.xml
step 2: inside editext_cursor.xml paste this:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:width="1dip" />
<solid android:color="#010101" />
</shape>
and here you can change the width to whatever you want.
step 3: add that line to android/app/src/main/res/values/styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:textColor">#000000</item>
<item name="android:textCursorDrawable">#drawable/editext_cursor</item> <-- add this
</style>
</resources>
step 4: rebuild your app
Because I wanted to use material input edit text, I had to change my style to
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
But my SnackBar style has changed, before it (which I was using AppCompat) my SnackBar was show in different mode, I mean, It came up from bottom and after a while it goes down, but now it is shown like a simple toast, it fade-in and then fade-out,
how can I use material component without having any change in my view styles?
Add following lines into styles.xml BaseTheme:
<resources>
<style name="BaseTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
...
<item name="snackbarStyle">#style/Widget.MaterialComponents.Snackbar</item>
<item name="snackbarButtonStyle">#style/Widget.MaterialComponents.Button.TextButton.Snackbar</item>
<item name="snackbarTextViewStyle">#style/Widget.MaterialComponents.Snackbar.TextView</item>
</style>
</resources>
How can I change this background color of TextInput when it got highlight from the autoCompleteType that already exists on react native?
like on this image
To customize this autofill bg color, you have to set this at android level.
Create a xml file with the name of your choice, for example autofill_highlight.xml in android/app/src/main/res/drawable
Put this code inside :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#android:color/transparent" />
</shape>
Here, the color set is transparent ("#android:color/transparent"), replace it with your color.
In android/app/src/main/res/values/styles.xml, add this line to your app theme (make sure to provide your own file name if you don't call it autofill_highlight like in my example)
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- ... your other theme customization ... -->
<!-- ADD THE FOLLOWING LINE -->
<item name="android:autofilledHighlight">#drawable/autofill_highlight</item>
</style>
</resources>
Rebuild your application :)
Below is the code for XAML for customNavigation in Xamarin. The bar color is not set but Bar text color is set. And this is only happening in Android, iOS works fine.
<NavigationPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="DSXMobile.Views.CustomNavigationView"
BarBackgroundColor="Red"
BarTextColor="Black">
</NavigationPage>
Can anyone please help me ?
This is a known issue,
From Xamarin forums https://forums.xamarin.com/discussion/88569/barbackgroundcolor-refusing-to-get-set-on-android-but-bartextcolor-is-fine
"If you are using FormsAppCompatActivity
This is a bug in XF if you're using the FormsAppCompatActivity.
The workaround is to set android:background in your applications' layout file used for FormsAppCompatActivity.ToolbarResource.
Set this value to anything, example: android:background="#00000000"
Then XF will style it with whatever colour is in your XAML style later.
Really dumb bug, hope it gets sorted soon."
Another reference:
https://forums.xamarin.com/discussion/37657/how-to-change-the-nav-bar-background-color-on-android
Two annoying Custom Renderer Solutions:
https://forums.xamarin.com/discussion/17811/tabbedpage-tabbar-background-color-tint
https://forums.xamarin.com/discussion/59828/change-barbackgroundcolor-dynamically
Like the other answer says its a bug but i don't know if it should be called a bug because android is doing what it does picking the theme that you have assigned to its activity in your styles.xml now what you can do is make that same change in your styles.xml my theme something like this :
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MyTheme" parent="MyTheme.Base">
</style>
<style name="DrawerArrowStyle"
parent="#style/Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#FFFFFF</item>
</style>
<style name="MyTheme.Base"
parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#003399</item>
<item name="colorPrimaryDark">#003399</item>
<item name="colorControlHighlight">#003399</item>
<item name="colorAccent">#012348</item>
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
</style>
</resources>
Changing the colors in here will change it there aswell for eg ColorPrimary is your toolbar color
I would like to change the background title color in the recent apps view (when you press the Overview square button on Android) using react-native.
You can see in the image below that the Facebook app has a blue background color, but my Bitcoin FOMO Calculator app has the default gray color.
Thanks
1.Create colors.xml into android/app/src/main/res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Change the color value for your need -->
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
2.Modify the styles.xml inside android/app/src/main/res/values/styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
</resources>
3.The result and more detail about Android Style and Theme: