after update android studio to version 3.1.4
Can not use ?attr/actionBarSize
in xml.
Asked
Active
Viewed 468 times
0

Pouria Hemi
- 706
- 5
- 15
- 30
-
any logcat or error messages. – navylover Sep 17 '18 at 09:13
-
@navylover Cannot resolve symbol '?attr/actionBarSize' less... Validates resource references inside Android XML files. – Pouria Hemi Sep 17 '18 at 09:15
3 Answers
4
You should use
?android:attr/actionBarSize
XML
android:layout_height="?android:attr/actionBarSize"

IntelliJ Amiya
- 74,896
- 15
- 165
- 198
1
You can use the ?attr/actionBarSize
still, the issue is that Android Studio is showing error on ?attr/actionBarSize
. Almost every android developer has faced this issue in AS 3+.
Solution
- Close project
- Open project again (not from recent)
Resolved! :)
By the way, all below works still
android:layout_height="?actionBarSize"
android:layout_height="?android:actionBarSize"
android:layout_height="?attr/actionBarSize"
Related question :
Why does Android Studio highlight "Theme" red in styles.xml?

Khemraj Sharma
- 57,232
- 27
- 203
- 212
0
You should use this
android:layout_height="?android:attr/actionBarSize"
instead of
android:layout_height="?attr/actionBarSize"

Faysal Ahmed
- 7,501
- 5
- 28
- 50