Android TableLayout设计模板

 

 

TableLayout比较常用,设计简洁.

 

xxxxxActivity.java:

package com.fp.xxx

 

import android.app.Activity;

import android.content.Intent;

import android.os.Bundle;

import android.view.View;

 

public class xxxxxActivity extends Activity  implements View.OnClickListener

{

 

    @Override

    public void onCreate(Bundle savedInstanceState) {  

        super.onCreate(savedInstanceState);  

        setContentView(R.layout.wirelesscity_main);

 

        findViewById(R.id.xxxxx).setOnClickListener(this);

    }

    public void onClick(View v) {

        switch(v.getId()) {

        case R.id.wcm_jglz:

            ....

            break;

    }

}

 

layout/xxxxx.xml:

<?xml version="1.0" encoding="utf-8"?>

 

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:id="@+id/wc_main" 

        android:layout_width="fill_parent" 

        android:layout_height="fill_parent"

        android:stretchColumns="1"

        android:background="#FFF">

 

    <TableRow>

        <Button android:id="@+id/wcm_jglz"

            android:background="@drawable/xxxxxxxx"

            android:layout_width="fill_parent"

            android:layout_height="wrap_content"

            style="@style/xxxxxxx"

            android:text="xxxxxxx"/>

    </TableRow>

    <TableRow>

        ......

    </TableRow>

    <TableRow>

        ......

    </TableRow>

    <TableRow>

        ......

    </TableRow>

</TableLayout>

转载注明出处: http://blog.csdn.net/ccwwff/archive/2010/08/20/5826560.aspx

 

你可能感兴趣的:(android,layout,Class,button,encoding,2010)