Vai*_*hra 2 android button android-button
我试图使用android的内置控件CompoundButton,但我没有运气在xml中使用它,这是我的代码
<CompoundButton
android:id="@+id/mini_recorder_play"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/play_d" />
Run Code Online (Sandbox Code Playgroud)
在充气时抛出异常.
Dev*_*red 11
CompoundButton是一个抽象类,你不能直接实例化它.您必须实例化它的一个子类(例如CheckBox,RadioButton,ToggleButton),或者创建自己的子类,如果没有这些部件的适合您的需要.
HTH