我想创建一个CheckBox,我的编译
sdk version is 23,
Target version is 23,
build tool version is 23.0.0,
在gradle I'hv添加
compile 'com.android.support:support-v4:23.2.0',
compile 'com.android.support:appcompat-v7:23.2.0'
两者都在清单中,并将应用主题设为android:theme="@style/Theme.AppCompat.Light.NoActionBar"
,并且没有针对活动的特定主题。当我运行我的代码时抛出
InflateException line number #23 at xml file, problem while inflating kind of
然后我决定将一个简单的ChcekBox传递给android.support.v7.widget.AppCompatCheckBox
,但是在xml文件上预览它显示渲染问题以下类无法实例化:
- android.support.v7.widget.AppCompatCheckBox
Exception Details java.lang.ClassNotFoundException: android.support.v4.widget.TintableCompoundButton
如果我尝试运行它,它会为android.support.v4.widget.TintableCompoundButton not found
提供类文件。
那么,任何人都面临这个问题?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<LinearLayout
android:id="@+id/lnv_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/rlv_header"
android:orientation="vertical">
<android.support.v7.widget.AppCompatCheckBox
android:id="@+id/confirmCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:checked="false"
android:gravity="start"
android:text="@string/personal_confirm_text"
android:textColor="@color/black"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rlv_next"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="40dp"
android:background="@color/crabfx_light_gray"
android:visibility="gone">
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentTop="true"
android:background="@color/crabfx_green" />
<TextView
android:id="@+id/tv_next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:drawablePadding="10dp"
android:drawableRight="@drawable/discloser"
android:gravity="center_vertical"
android:text="@string/lbl_next"
android:textColor="@color/black"
android:textSize="18sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_alignParentBottom="true"
android:background="@color/crabfx_green" />
</RelativeLayout>
</RelativeLayout>
及以下是menifest中Application标签的主题 机器人:主题= “@风格/ Theme.AppCompat.Light.NoActionBar”