悄悄成长
for navigation
        RelativeLayout.LayoutParams relativeParams =
         new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
        relativeParams.addRule(RelativeLayout.CENTER_HORIZONTAL)
            LinearLayout.LayoutParams lineParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,     LinearLayout.LayoutParams.WRAP_CONTENT);

        LinearLayout line = new LinearLayout(this);
        LinearLayout line1 = new LinearLayout(this);

        line.addView(myTt0, lineParams);
        line.addView(myTx0, lineParams);
        line.addView(myTx1, lineParams);
        
        line1.addView(myTx, lineParams);
        
        relativeLayout.addView(line, relativeParams);    //Attention:if the two params are same, the larger layout will be cliped.
        relativeLayout1.addView(line1, relativeParams);
 ////////////////////////////////////////////////////////////
        So the relativeParams should use different ones attach to more than one layouts as below:

        relativeLayout.addView(line, relativeParams);
        relativeLayout1.addView(line1, relativeParams_c);
posted on 2008-03-06 19:19 Duan Bo Hao 阅读(322) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: