1
アンドロイドアプリのレイアウトにチェックボックスを追加しようとしていますが、表示されません。チェックボックスの横にあるテキストフィールドは表示されますが、チェックボックス自体は表示されません。どのようにこれを修正することができますか?アンドロイドのレイアウトにチェックボックスが表示されない
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.lenovo.myapplication.MainActivity"
android:orientation="vertical"
android:background="#0000ff"
>
<EditText
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Write your name"
android:textSize="50sp"
android:inputType="text"
android:layout_margin="16dp"
/>
<TextView
android:layout_margin="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Topping"
android:textSize="50sp"/>
<CheckBox
android:layout_width="500sp"
android:layout_height="50sp"
android:text="new checkbox"
android:textSize="50sp"
android:scaleX="0.7"
android:scaleY="0.7"
android:buttonTint="#000000"
/>
</LinearLayout>
は、あなたがコードを実行しようとした、このチェックボックスのXMLを試してみてください?場合によっては、プロジェクトをクリーンにして正常に動作させる必要があります。 – ZeroOne
チェックボックスの幅を "コンテンツをラップする"ように設定して、結果を確認してください。 –
@nassertahani幅を "wrap_content"に設定すると何も起こりません –