回答編集履歴
1
styles.xmlの記述が抜けた
test
CHANGED
@@ -3,6 +3,34 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
Activityのタイトルバーの代わりにサポートライブラリーが提供するToolbarを使用、Toolbarの子要素としてTextViewを配置、このTextViewにAPI 26で導入された[Autosizing TextViews](https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview.html)を適用することで実現できます。
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
res/styles.xml(標準のタイトルバーをNoActionBarに書き換える)
|
10
|
+
|
11
|
+
```XML
|
12
|
+
|
13
|
+
<resources>
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
18
|
+
|
19
|
+
<!-- Customize your theme here. -->
|
20
|
+
|
21
|
+
<item name="colorPrimary">@color/colorPrimary</item>
|
22
|
+
|
23
|
+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
24
|
+
|
25
|
+
<item name="colorAccent">@color/colorAccent</item>
|
26
|
+
|
27
|
+
</style>
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
</resources>
|
32
|
+
|
33
|
+
```
|
6
34
|
|
7
35
|
|
8
36
|
|