after update android studio to version 3.1.4 Can not use ?attr/actionBarSize in xml.
Asked
Active
Viewed 404 times
0
Pouria Hemati
- 647
- 5
- 13
- 29
-
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 Hemati Sep 17 '18 at 09:15
3 Answers
4
You should use
?android:attr/actionBarSize
XML
android:layout_height="?android:attr/actionBarSize"
IntelliJ Amiya
- 73,189
- 14
- 161
- 193
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
- 52,662
- 21
- 188
- 195
0
You should use this
android:layout_height="?android:attr/actionBarSize"
instead of
android:layout_height="?attr/actionBarSize"
Faysal Ahmed
- 7,003
- 5
- 27
- 47