Java 工具栏的文本大小和样式

Java 工具栏的文本大小和样式,java,android,xml,Java,Android,Xml,我正在开发具有多屏幕支持的应用程序。我已经按照设备大小完成了所有剩余布局,但我无法为相同的设备增加操作栏/工具栏大小。10英寸的平板电脑看起来很小。如何增加工具栏文本的大小 我的XML风格如下所示 <resources> <!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xm

我正在开发具有多屏幕支持的应用程序。我已经按照设备大小完成了所有剩余布局,但我无法为相同的设备增加操作栏/工具栏大小。10英寸的平板电脑看起来很小。如何增加工具栏文本的大小

我的XML风格如下所示

<resources>

<!--
    Base application theme, dependent on API level. This theme is replaced
    by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">

</style>


<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.FullScreen" parent="noActionBar">
<item name="android:windowFullscreen">true</item>
</style>
<style name="noActionBar" parent="Theme.AppCompat.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<style name="OptionDialog" parent="Theme.AppCompat.Dialog.Alert">

    <item name="colorAccent">#C5CAE9</item>
    <item name="android:background">#3F51B5</item>
    <item name="android:textColor">?android:attr/textColorPrimaryInverseDisableOnly</item>
</style>


<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="SelectableItemTheme">
    <item name="colorControlHighlight">#888888</item>
</style>

<style name="SelectableItemBackground">
    <item name="android:theme">@style/SelectableItemTheme</item>
    <item name="android:background">?attr/selectableItemBackground</item>
</style>


<style name="HomeTabTextStyle" 
    parent="TextAppearance.Design.Tab"> 
    <item name="android:textSize">35sp</item> 
    <item name="android:textStyle">bold</item> 
    </style>

<!-- Action Bar Style -->

工具栏和其他布局一样;这意味着您可以像这样在其中添加元素:

     <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="25sp"
            android:textColor="@color/colorText"
            android:gravity="center|center_horizontal"
            android:text="@string/title_activity_my_activity"/>

    </android.support.v7.widget.Toolbar>
<TextView
      android:id="@+id/title_text"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="25sp"
      android:textColor="@color/colorText"
      android:gravity="center|center_horizontal"
      android:text="@string/title_activity_my_activity"/>

我希望这有帮助

嗨!请看我的java代码…如何根据您的答案进行更改?因为我没有使用textview…谢谢你基本上可以像我上面所做的那样将这个textview添加到你的工具栏中,每个文件夹中的文本大小不同,设备大小也不同。是的…我理解了,谢谢你的帮助,但实际上我在问我应该在java代码中更改什么来使用这个textview?请检查我在问题中添加的java代码。。。再次感谢并为我的知识不足感到抱歉:(您实际上不需要更改任何内容;除非您想手动设置活动标题;在这种情况下,您可以检查我的更新代码嗨!明白了:)谢谢先生:)
     <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="25sp"
            android:textColor="@color/colorText"
            android:gravity="center|center_horizontal"
            android:text="@string/title_activity_my_activity"/>

    </android.support.v7.widget.Toolbar>
<TextView
      android:id="@+id/title_text"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="25sp"
      android:textColor="@color/colorText"
      android:gravity="center|center_horizontal"
      android:text="@string/title_activity_my_activity"/>
TextView title = (TextView) toolbar.findViewById(R.id.title_text);
title.setText("New Title");