How to change size of title’s text on Action Bar?

Actually, you can do what you want to customize the ActionBar. It must be done through the Theme. You can do something like this : <style name=”Theme.YourTheme” parent=”android:style/Theme”> <item name=”android:actionBarStyle”>@style/Theme.YourTheme.Styled.ActionBar</item> </style> <style name=”Theme.YourTheme.Styled.ActionBar”> <item name=”android:titleTextStyle”>@style/Theme.Viadeo.Styled.YourTheme.TitleTextStyle</item> </style> <style name=”Theme.YourTheme.Styled.ActionBar.TitleTextStyle” parent=”@android:style/Widget.TextView”> <item name=”android:textSize”>12sp</item> </style>

how to change font size of flutter material button?

The widget architecture in Flutter makes this very simple: The child of the MaterialButton is a Text widget, which can be styled with its style property: new MaterialButton( height: 140.0, minWidth: double.infinity, color: Theme.of(context).primaryColor, textColor: Colors.white, child: new Text( “material button”, style: new TextStyle( fontSize: 20.0, color: Colors.yellow, ), ), onPressed: () => {}, splashColor: … Read more

Inconsistency when setting TextView font size in code and in resources

You should use setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); because the documentation of the getDimension method states that it returns a Resource dimension value multiplied by the appropriate metric. which I understand to be the precalculated absolute px value. That is, use: tv.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimension(R.dimen.text_size_small));

How to change the toolbar text size?

Use app:titleTextAppearance: <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”?actionBarSize” android:id=”@+id/toolbar” app:titleTextAppearance=”@style/Toolbar.TitleText” /> and override the default title size in a custom style: <style name=”Toolbar.TitleText” parent=”TextAppearance.Widget.AppCompat.Toolbar.Title”> <item name=”android:textSize”>18sp</item> </style> Result:

Text size and different android screen sizes

@forcelain I think you need to check this Google IO Pdf for Design. In that pdf go to Page No:77 in which you will find how there suggesting for using dimens.xml for different devices of android for Example see Below structure : res/values/dimens.xml res/values-small/dimens.xml res/values-normal/dimens.xml res/values-large/dimens.xml res/values-xlarge/dimens.xml for Example you have used below dimens.xml in … Read more

What is the default text size on Android?

In general: Three “default” textSize values: – 14sp – 18sp – 22sp These values are defined within the following TextAppearances: – TextAppearance.Small – TextAppearance.Medium – TextAppearance.Large More information about Typography can be found in the design guidelines Related to your question: If you don’t set a custom textSize or textAppearance, TextAppearance.Small will be used. Update: … Read more

Different font size of strings in the same TextView

Use a Spannable String String s= “Hello Everyone”; SpannableString ss1= new SpannableString(s); ss1.setSpan(new RelativeSizeSpan(2f), 0,5, 0); // set size ss1.setSpan(new ForegroundColorSpan(Color.RED), 0, 5, 0);// set color TextView tv= (TextView) findViewById(R.id.textview); tv.setText(ss1); Snap shot You can split string using space and add span to the string you require. String s= “Hello Everyone”; String[] each = s.split(” … Read more