Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From another <a href="https://stackoverflow.com/questions/2151241/android-how-to-change-checkbox-size">question</a> here on SO:</p> <blockquote> <p>You just need to set the related drawables and set them in the checkbox:</p> </blockquote> <pre><code>&lt;CheckBox android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new checkbox" android:background="@drawable/my_checkbox_background" android:button="@drawable/my_checkbox" /&gt; </code></pre> <blockquote> <p>The trick is on how to set the drawables. <a href="http://www.anddev.org/tutorial_change_look_of_checkbox-t4553.html" rel="nofollow noreferrer">Here's a good tutorial about this</a>.</p> </blockquote> <p>EDIT: Just to make it a bit more clear, you will need these files to make the tutorial work:</p> <p>CheckBoxTestActivity.java:</p> <pre><code>import android.app.Activity; import android.os.Bundle; public class CheckBoxTestActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } </code></pre> <p>main.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;CheckBox android:id="@+id/checkBox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Checked CheckBox" android:checked="true"/&gt; &lt;CheckBox android:id="@+id/checkBox2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Unchecked CheckBox" /&gt; &lt;CheckBox android:id="@+id/checkBox3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/checkbox_background" android:button="@drawable/checkbox" android:text="New Checked CheckBox" android:checked="true"/&gt; &lt;CheckBox android:id="@+id/checkBox4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/checkbox_background" android:button="@drawable/checkbox" android:text="New Unchecked CheckBox" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>checkbox.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_checked="false" android:drawable="@drawable/checkbox_off_background"/&gt; &lt;item android:state_checked="true" android:drawable="@drawable/checkbox_on_background"/&gt; &lt;/selector&gt; </code></pre> <p>checkbox_background.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:drawable="@drawable/btn_check_label_background" /&gt; &lt;/selector&gt; </code></pre> <p>and btn_check_label_background.9.png, checkbox_off_background.png and checkbox_on_background.png from the tutorial page.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload