Android Studio - rendering of support library issue -
i've got problem rendering of layout preview in android studio, while using classes google support libraries (appcompat-v7, support-v4).
example (same goes every other element support libraries):
the following classes not found: - android.support.v7.widget.toolbar (fix build path, edit xml, create class)
the libraries added dependencies list of build.gradle:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.android.support:support-v4:22.1.1' }
the thing is, when change class name in xml <toolbar>
instead of <android.support.v7.widget.toolbar>
, rendered perfectly, won't run on older api versions. changing rendering api version not fix it, neither changing app theme or building / cleaning project.
the application runs on older , new apis without problems - it's rendering annoys me, i've tried i've found on stack overflow regarding such issues, , still not fix it. seems me, android studio layout renderer not see classes added in dependency list.
below code custom application toolbar:
<android.support.v7.widget.toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:paddingtop="@dimen/padding_top" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/primarycolor" app:theme="@style/customtoolbartheme" />
have @ answer nadir williams here. said
isnt theme attribute supposed android:theme instead of app:theme?
does help?
Comments
Post a Comment