开发者

imageButton draw in bottom of the layout

I have ImageButton which create inside the code,

    // Create Button 
    ImageButton imageButton = new ImageButton(mContext);
    imageButton.setBackgroundRe开发者_StackOverflow社区source(R.drawable.button);

    imageButton.setOnClickListener(this);
    LayoutParams myParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

    addContentView(imageButton, myParams);

How can i draw it in the bottom of the layout ?


Try:

LinearLayout.LayoutParams lp= (LinearLayout.LayoutParams)myButton.getLayoutParams(); 
lp.layout_gravity=Gravity.BOTTOM; 
myButton.setLayoutParams(lp); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜