Morticella Morticella  Facebook Morticella Fumetti RSS

mercoledì 22 settembre 2010

Android 4 : UI CheckBox

In questo video tutorial continueremo ad esplorare la UI di Android, come sempre useremo Arm per velocizzare il nostro lavoro di scrittura codice.Che altro dire ? Guardatevi il video tutorial








Codice principale del tutorial  [ per produrre il tuo codice visita ARM ]

Quick Reference

<CheckBox
android:id="@+id/CheckBox01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CheckBox"
/>

Full main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/UI4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
><CheckBox
android:id="@+id/CheckBox01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:text="TextView"
android:textSize="14sp"
android:textColor="#FFFFFF"
android:textStyle="normal"
android:padding="0px"
android:gravity="center"
android:checked="false"
android:layout_marginTop="0px"
android:layout_marginLeft="0px"
/></LinearLayout>

Java

package TUO.PACKAGE.TUONOME;


import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.CheckBox;


public class tutorial extends Activity {
    
    /** Called when the activity is first created. */
    @Override
 
    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
          this.setContentView(R.layout.main);
          CheckBox CheckBox01  = (CheckBox) findViewById(R.id.CheckBox01);
          CheckBox01.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
               
            }
          });
        }
}

Richiedi il tuo video tutorial

Nessun commento:

Posta un commento

Il tuo commento é veramente importante