Archives





Bingung

Vyta Pratami Ningsih

Tuk Lihat Macam-macam blog vyta lihat di Categori dan Favorite :))

My Family

Go to Blogger.

My Frends

Tuk Lihat Macam-macam blog vyta lihat di Categori dan Favorite :))

Sabtu, 05 November 2011

CheckBox

xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
     android:text="Makanan Kesukaan:">
    TextView>
      <CheckBox android:text="Pizza"                                         
      android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
      <CheckBox android:text="J-Co"                                    
      android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
      <CheckBox android:text="KFC"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
      <CheckBox android:text="Dunkin Donut"                                        
      android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

LinearLayout>

MultiAutoCompleteTextView


package com.android.vyta;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.MultiAutoCompleteTextView;
import android.widget.TextView;

public class MACTextViewVytaActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        LinearLayout ly=new LinearLayout(this);
        TextView txt=new TextView(this);
        txt.setText("Nama kota di Indonesia : ");
        ly.addView(txt);
  MultiAutoCompleteTextView mactv = new MultiAutoCompleteTextView(this);
        ArrayAdapter aa2 = new ArrayAdapter(this,
        android.R.layout.simple_dropdown_item_1line,new String[] {"Bukittinggi", "Jakarta", "Surabaya", "Bali", "Semarang","Balikpapan"});
        mactv.setAdapter(aa2);
        mactv.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
        mactv.setWidth(500);
        mactv.setHeight(50);
        ly.addView(mactv);
        setContentView(ly);

    }
}

Linear Layout


xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<TextView
android:text="red"
android:gravity="center_horizontal"
android:background="#aa0000"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="green"
android:gravity="center_horizontal"
android:background="#00aa00"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="blue"
android:gravity="center_horizontal"
android:background="#0000aa"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="yellow"
android:gravity="center_horizontal"
android:background="#aaaa00"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"/>
LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<TextView
android:text="red"
android:gravity="center_horizontal"
android:background="#aa0000"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="green"
android:gravity="center_horizontal"
android:background="#00aa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="blue"
android:gravity="center_horizontal"
android:background="#0000aa"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
<TextView
android:text="yellow"
android:gravity="center_horizontal"
android:background="#aaaa00"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"/>
LinearLayout>
LinearLayout>

Twitter Delicious Facebook Digg Stumbleupon Favorites More