Center text of a Xamarin Forms TabbedPage Title - xamarin.forms

i have a TabbedPage with multiple Child-Pages, with a title each.
When the title is short enough to be single line the text gets centered perfectly, but as soon as the text needs more than 1 line it is no longer centered.
Can anyone tell me how to fix this?

I think it's impossible to do in common way for all platforms, and you have to do it in platform specific way.
For android project I did it in such way:
In file Styles.xml from folder Resources/values I added style
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomTheme"
parent="#android:style/Theme.Holo">
<item name="android:actionBarTabTextStyle">#style/CustomTab</item>
</style>
<style name="CustomTab"
parent="#android:style/Widget.Holo.ActionBar.TabText">
<item name="android:gravity">center</item>
</style>
</resources>
And in MainActivity.cs I added
[Activity(Theme = "#style/CustomTheme")]
For Windows phone I found this article https://nocture.dk/2014/12/10/xamarin-forms-customizing-tabbed-page-header-title-windows-phone/, but didn't try it.
For iOS i didn't check too http://jfarrell.net/2015/02/25/customizing-the-tab-bar-on-ios-with-xamarin-forms/.

Related

Xamarin.Forms disable Shell TabBar font scale when selected

Is there any way to disable behavior of tab bar scaling font size for selected items on Android?
It cuts off titles when selected which is very annoying.
I could not find TabBar renderer kind of thing to change behavior on Android side.
The last item 'Notificaitons' are being cut to 'Notificatio' when it is selected.
Create a dimens.xml in Android> Resource> values. And then add the following XML to override the size of the text when it is active and not active:
<?xml version="1.0" encoding="utf-8" ?>
<resources xmlns:tools="http://schemas.android.com/tools">
<dimen name="design_bottom_navigation_text_size" tools:override="true">12sp</dimen>
<dimen name="design_bottom_navigation_active_text_size" tools:override="true">12sp</dimen>
</resources>
Before:
After:

Xamarin Forms Shell Textcolor in Android Modal is not applied

I have a Xamarin Forms Shell Application in which I open several pages as Modal. I would like to set the bar text color to a chosen value so, that you can actually read the text in the dark and the light theme. This is the navigation code:
return shell.Navigation.PushModalAsync(new NavigationPage(page)
{
BarBackgroundColor = Color.Transparent,
BarTextColor = Color.Red
});
(Red is only as an example to clearly be able to see the color change).
On iOS the color is adjusted as expected:
But on Android the color stays always white:
Open your styles.xml file, add <item name="android:actionMenuTextColor">#ff0000</item> in your Theme.AppCompat.DayNight.NoActionBar style.
<style name="MyTheme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/orange</item>
<item name="colorPrimaryDark">#color/orangeDark</item>
<item name="colorAccent">#color/colorAccent</item>
<!--<item name="android:textColorPrimary">#fb2b32</item>-->
<item name="android:actionMenuTextColor">#ff0000</item>
</style>
Here is running screenshot.

Set "Splash Screen" color for Android TV App

How can I set/change the color of this animated screen for my app?
OK, Finally I've figured it out.
This color is taken from Theme. You should overwrite the android:colorPrimary to change this color.
This is called "Changing Launcher color"
To customize the color of this animation, set the android:colorPrimary attribute of your TV app or activity to a specific color.
<resources>
<style ... >
<item name="android:colorPrimary">#color/primary</item>
</style>
</resources>
For More info, you can check this link
https://developer.android.com/training/tv/start/start.html

Widget in Adobe AIR position bottom-right

Thanks in advance.
I'm a graphic designer.
I have to make a widget that shows some icons.
I've made an icon that starts in systemtray, all I need is to make the window application that start at bottom over the icon.
I don't know anything about flex...
I've done this so far in application.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<application xmlns="http://ns.adobe.com/air/application/1.0">
<id>com.widgetStatus.widgetStatus</id>
<filename>widgetStatus</filename>
<name>widgetStatus</name>
<description>Test</description>
<version>0.1a</version>
<initialWindow>
<content>html/index.html</content>
<title>widgetStatus</title>
<systemChrome>none</systemChrome>
<transparent>true</transparent>
<visible>true</visible>
<minimizable>false</minimizable>
<resizable>false</resizable>
<width>400</width>
<height>300</height>
<x>1268</x>
<y>646</y>
</initialWindow>
<icon>
<image128x128>/icons/widget128.png</image128x128>
<image48x48>/icons/widget48.png</image48x48>
<image32x32>/icons/widget32.png</image32x32>
<image16x16>/icons/widget16.png</image16x16>
</icon>
The application starts over the systray but only with my resolution obliuvsly.
Now I need to do something like that:
Positioning Flex/AIR Desktop App Window to the bottom right corner
How can I work with that script in flex? I understand that I can put the code into xml.
Thanks.

css not working on my firefox extension toolbar

iam writing a simple firefox toolbar, but i have failed to set a few list style images with css. Please help.
//
katimbatoolbar.css
(found in chrome/skin) folder
#katimbatoolbarstart
{
list-style-image :url("chrome://katimbatoolbar/skin/button-1.png");
}
katimbatoolbar.xul (my user interface file, found in "chrome/content/" folder)
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://katimbatoolbar/skin/tuttoolbar.css" type="text/css"?>
<overlay id="katimbatoolbaroverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript"
src="chrome://katimbatoolbar/content/katimbatoolbar.js" />
<toolbox id="navigator-toolbox">
<toolbar id="katimbatoolbar" toolbarname="katimba suite" accesskey="k"
class="chromeclass-toolbar" context="toolbar-context-menu"
hidden="false" persist="hidden">
<toolbarbutton id="katimbatoolbarstart" tooltiptext="start surfing using katimba ++"
label="Start" oncommand="katimbaClass.installLocalHost()"/>
</toolbar>
</toolbox>
</overlay>
Here is my chrome.manifest file
content katimbatoolbar chrome/content/
overlay chrome://browser/content/browser.xul chrome://katimbatoolbar/content/katimbatoolbar.xul
skin katimbatoolbar classic/1.0 chrome/skin/
The toolbar works fine, but really looks ugly since the css is not working. Any help appreciated in advance.
By the way, Here is my folder structure
mytoolbar/
install.rdf
chrome.manifest
chrome/
content/
katimbatoolbar.xul
katimbatoolbar.js
skin/
katimbatoolbar.css
button-1.png
In your XUL file you reference chrome://katimbatoolbar/skin/tuttoolbar.css while the file in your folder structure is called katimbatoolbar.css. Plus, you define
content katimbatoolbar chrome/content/
but the folder structure starts with mytoolbar.

Resources