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);
精彩评论