2
嘗試使用Android Studio創建Android應用程序。雖然使用複選框有問題:沒有實際的複選框出現。只有它的文字。 收到有關缺失樣式的消息(鏈接到屏幕截圖如下)。Android Studio:未能在當前主題中找到樣式「checkboxStyle」
http://i.stack.imgur.com/0Tzdf.png
我如何處理呢?
XML file
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity"
android:padding="20dp">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pizza"
android:textSize="20sp"
android:id="@+id/cbPizza"
android:checked="false"
android:allowUndo="false" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cbHamburger" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="HamBurger"
android:id="@+id/textView" />
</LinearLayout>
</LinearLayout>
Manifest
文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alesto.checkbox" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
請問您可以添加您的XML。 –
添加活動和清單xmls @AkshayShinde – Alesto
在窗口的上方選擇應用程序主題。不用擔心渲染。你仍然可以運行你的應用程序。 –