に次のテーマがありますres/values/styles.xml
。
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppBaseTheme" parent="@android:style/Theme.NoTitleBar">
</style>
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
</style>
</resources>
行を削除する<item name="android:windowNoTitle">true</item>
と、アクティビティにタイトルバーが表示されます。ただし、その行をそのままにしておくと、タイトルバーがありません(これが必要です)。
なぜparent="@android:style/Theme.NoTitleBar"
効果がないように見えるのですか?parent
私が思っていることをしませんか?私はそれが次のように機能すると思いました:
@android:style/Theme.NoTitleBar --> AppBaseTheme --> AppTheme
^ ^ ^
| | |
| | Has everything AppBaseTheme
| | does, unless it's overridden
| |
| Has everything @android:style/Theme.NoTitleBar
| does, unless it's overridden (which I'm not
| doing)
|
Sets whatever it needs to to not have a title, which I assume
is done by setting <item name="android:windowNoTitle">true</item>
<item name="android:windowNoTitle">true</item>
ただし、設定しAppBaseTheme
ても効果がないこともわかりました。に設定する必要がありAppTheme
ます。では、一体、親を指定するポイントは何ですか?