我有一个应用程序,其中我使用style="@style/Base.Widget.AppCompat.RatingBar.Small"
作为评级栏。现在我必须使用浮动操作按钮。这是我的依赖结构
dependencies {
ext {
supportLibVersion = '23.2.0'
}
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:percent:${supportLibVersion}"
compile "com.android.support:design:${supportLibVersion}"
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile "com.android.support:recyclerview-v7:${supportLibVersion}"
compile 'com.loopj.android:android-async-http:1.4.9'
compile 'com.github.orhanobut:logger:1.12'
compile files('libs/lefu_sdk_r8.jar')
compile files('libs/achartengine-1.2.0.jar')
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
}
当我尝试使用浮动操作按钮时,我得到android.content.res.Resources$NotFoundException:
。搜索后我从这个链接Android Studio FloatingActionButton error知道我应该将支持库版本更改为23.1.0。但后来我无法将上述风格用于评级栏。任何人都可以建议解决这个问题。这是我在使用FAB时遇到的错误
Rendering Problems The following classes could not be instantiated:
- android.support.design.widget.FloatingActionButton (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details android.content.res.Resources$NotFoundException: Resource ID #0x7f080055 type #0x0 is not valid at android.content.res.Resources.getDimension(Resources.java:624) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:128) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:811) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy stack to clipboard
这是我将支持库版本更改为23.1.0时出现的错误Error:(103, 24) No resource found that matches the given name (at 'style' with value '@style/Base.Widget.AppCompat.RatingBar.Small').