How to Painlessly Change My App Title Text Color

Android app label color

styles.xml

<style name="MyTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/MyActionBar</item>

</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#FF9D21</item>
<item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style>
<style name="MyActionBarTitleText"
parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@color/red</item>
</style>

colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="red">#FF0000</color>
</resources>

For more info

https://developer.android.com/training/basics/actionbar/styling.html#CustomText

Snap

Sample Image

Edit : For making it bold

 <style name="MyActionBarTitleText"
parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">@color/red</item>
<item name="android:textStyle">bold</item>
</style>

Change color of blue line under title view in dialogpreference

Ok I figured it out, but its a hacky solution. For DialogPreferences, the AlertDialog.Builder methods aren't called until showDialog() (see here).

Knowing that and modifying the solution from here, we can get rid of the title with the
Window.FEATURE_NO_TITLE flag and inflate our own XML with a title and our own horizontal divider built-int:

@Override
protected void showDialog(Bundle state) {
Context context = getContext();
AlertDialog.Builder mBuilder = new AlertDialog.Builder(context);
View view = LayoutInflater.from(context).inflate(R.layout.pref_dialog_about_title, null);

onBindDialogView(view);
mBuilder.setView(view);
onPrepareDialogBuilder(mBuilder);

// getPreferenceManager().registerOnActivityDestroyListener();

// Create the dialog
final Dialog dialog = mBuilder.create();
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
if (state != null) {
dialog.onRestoreInstanceState(state);
}

dialog.setOnDismissListener(this);
dialog.show();

Button neutralButton = ((AlertDialog)dialog).getButton(DialogInterface.BUTTON_NEUTRAL);
FontChanger.getInstance(getContext()).changeFont(neutralButton);
neutralButton.setTextColor(mColorOrangeEnabled);
neutralButton.setBackgroundDrawable(getContext().getResources().getDrawable(R.drawable.ab_background_gradient_bottom));
}

where onBindDialogView(View view) simply locates the TextViews (title and message) and initializes them. onPrepareDialogBuilder() just calls setNeutralButton(...).

pref_dialog_about_title.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/title_template"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/ab_background_gradient_top">
<TextView
android:id="@+id/alertTitle"
style="?android:attr/textAppearanceLarge"
android:layout_marginTop="6dip"
android:layout_marginBottom="9dip"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:singleLine="true"
android:ellipsize="end"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/border">

<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"/>
<TextView
android:id="@+id/btag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/author"
android:layout_centerHorizontal="true"/>

</RelativeLayout>
</LinearLayout>

ab_background_gradient_top:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Bottom Line -->
<item>
<shape android:shape="rectangle">
<solid android:color="@color/orange" />
</shape>
</item>

<!-- Color of your action bar -->
<item android:bottom="2dip">
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:centerColor="#3b0808"
android:endColor="#570b0b"
android:startColor="#1d0404"
android:type="linear" />

<corners
android:radius="0dp"/>
</shape>
</item>
</layer-list>

Changing the ActionBar title color of an Android app

Change android:theme="@android:style/Theme.Holo.Light" in your manifest to android:theme="@style/myActionbarTheme", and get rid of the pointless second <application> element. There is only one <application> element per Android manifest at this time.

shiny navbarpage title href color change from blue to white

Is this what you want?

runApp(list(
ui = navbarPage(inverse = TRUE,
title=HTML("<a style=color:white; href=\"http://stackoverflow.com\">stackoverflow</a>"),
tabPanel("tab1")
),
server = function(input, output) { }
))

Sencha Architect 4.2 - How to painlessly change title in generated index.html

In Application you can set the title config option.

// @require @packageOverrides
Ext.Loader.setConfig({

});


Ext.application({
models: [
'Car'
],
views: [
'CascadingSelect'
],
name: 'CascadingSelect',
title: 'Some Title Here',

requires: [
'Ext.window.MessageBox'
],

launch: function() {
Ext.create('CascadingSelect.view.CascadingSelect');
}

});

How to increase font size in the Xcode editor?

Update! - Behold Xcode 9 to the rescue!
Now you can use cmd + to increase the fonts with Xcode 9.
It took 5 Major releases for you to get it, Apple! But better late than never.

figured it out - however it was not very intuitive.

First some Pain Points

  1. When You try to change the font size directly using edit -> format -> font, nothing happens! - Not a good UX ... moreover why play dumb when you can tell user that they are using default or "System-owned" theme and they cannot change it? - Bad Design and more bad UX ... Why keep this option (Cmd t) alive, which by the way is most standard way to increase font size across most well behaved mac apps, if you do not want user to change the font this way?

  2. In Xcode preferences, when you try to change the font size by clicking on "fonts and colors", thats when XCode gives a pop-up saying what needs to be done. Also making a duplicate and then changing the fonts and colors is a lot of work rather than giving a button that says "Restore to Defaults" if Apple is so worried about the user messing up the default settings!

The solution is that - you need to duplicate the theme and then modify the copy you just made and apply that copy - phew!

WPF ListView Inactive Selection Color

The ListBox template uses a system color called ControlBrush to set the inactive highlight color. Therefore, you can just override that color:

<ListBox>
<ListBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}">Red</SolidColorBrush>
</ListBox.Resources>
</ListBox>


Related Topics



Leave a reply



Submit