表格布局—计算器

表格布局—计算器_第1张图片



  
  
  

  
  


package com.eson.gridlayouttest ;

import android.app.Activity ;
import android.os.Bundle ;
import android.view.Gravity ;
import android.widget.Button ;
import android.widget.GridLayout ;

public class MainActivity extends Activity {
  GridLayout gridLayout ;
  String[] chars =new String[]{
  "7" , "8", "9" ,"/" ,
  "4" , "5", "6" ,"*" ,
  "1" , "2", "3" ,"-" ,
  "." , "0", "=" ,"+"
  } ;

  @Override
  public void onCreate (Bundle savedInstanceState) {
  super .onCreate(savedInstanceState) ;
  setContentView(R.layout. gridlayout );
  gridLayout = (GridLayout) findViewById(R.id. root );
  for ( int i = 0 ; i 




你可能感兴趣的:(表格布局—计算器)