Android 如何确定工具栏的文本大小?
我在清单文件中为工具栏定义了一个文本Android 如何确定工具栏的文本大小?,android,android-layout,android-studio,android-fragments,Android,Android Layout,Android Studio,Android Fragments,我在清单文件中为工具栏定义了一个文本 <activity android:name=".instandhalter_screen.WikiInstandhalterScreenActivity" android:label="Instandhalter > Wiki" android:parentActivityName=".instandhalter_screen.InstandhalterScreenAc
<activity
android:name=".instandhalter_screen.WikiInstandhalterScreenActivity"
android:label="Instandhalter > Wiki"
android:parentActivityName=".instandhalter_screen.InstandhalterScreenActivity"
android:screenOrientation="landscape">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="de.derdoenerdon.ressourcencockpit2.instandhalter_screen.InstandhalterScreenActivity" />
</activity>
我想“确定”文本的大小“InstandAlter>Wiki”
有办法吗
谢谢您必须创建一个主题并将其添加到清单中:
android:theme="@style/customizedTheme"
要创建主题,请在文件res/styles.xml中:
<style name="customizedTheme" >
<item name="android:textSize">50dp</item>
<-- You can add more style elements here -->
</style>
50dp
只需将android:textSize属性添加到styles.xml文件中定义的,即可更改ActionBar标题的文本大小
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- set the size of action bar title . -->
<item name="android:textSize">12sp</item>
</style>
12便士
谢谢,但是有没有办法确定我的“默认”值?是的,只要将50 DP更改为您想要的任何值就行了。这不起作用。它会改变文本的文本大小,当我需要某个文本时,例如按钮中的文本或其他内容,但actionbar中的文本大小仍然相同..谢谢,我如何向其添加特定的文本样式?您可以在活动中使用HTML,如getSupportActionBar().setTitle(HTML.fromHtml(“+您的标题在此+""));