TabWidget

package com.greenReader.tools;

import android.content.Context;

import android.util.AttributeSet;

import android.view.View;

import android.widget.LinearLayout;

import android.widget.LinearLayout.LayoutParams;

import android.widget.TabWidget;

public class VerticalTabWidget extends TabWidget{

  

  public VerticalTabWidget(Context context, AttributeSet attrs){

             super(context,attrs);

             setOrientation(LinearLayout.VERTICAL);

   }

   @Override

     public void addView(View child){

          if(child.getLayoutParams() == null){

                 LinearLayout.LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT,0,1.0f);

                 lp.setMargins(0,0,0,0);

                child.setLayoutParams(lp);

          }

         super.addView(child);

      }

}

posted @ 2011-10-05 23:32  镇水古月  阅读(191)  评论(0编辑  收藏  举报