2

アプリケーションでここに記載されているオン/オフ スイッチが必要です。しかし、以下に示すように、スイッチの設計中に私のレイアウトでエラーが発生します <Switch android:textOn="ON" android:textOff="OFF" android:layout_width="wrap_content" android:layout_height="wrap_content"/>

私が得ているエラーは

`ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.619
!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme

!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.620
!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme

!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.620
!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme


!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.621

!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme


!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.622

!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme


!ENTRY com.android.ide.eclipse.adt 4 0 2012-07-12 16:33:07.622

!MESSAGE main.xml: Failed to find style 'switchStyle' in current theme


!ENTRY com.android.ide.eclipse.adt 2 0 2012-07-12 16:33:07.637

!MESSAGE main.xml: You must supply a layout_width attribute.


!ENTRY com.android.ide.eclipse.adt 2 0 2012-07-12 16:33:07.638

!MESSAGE main.xml: You must supply a layout_height attribute.

私のxmlファイル。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

<Switch
    android:textOn="ON"
    android:textOff="OFF"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />
</LinearLayout>
4

1 に答える 1