我制作了动态小工具(图片视图)但我无法调整高度!!
PLZ帮帮我T_T
如果我单击addButton,则应用程序调用createwidget()方法。
有一个nace日!!
private void createwidget(View view){
rimg=new ImageView(this);
rimg.setImageResource(R.mipmap.avatar);
rimg.setPadding(0,5,0,0);
rimg.setScaleType(ImageView.ScaleType.FIT_XY);
rimg.setId(DYNAMIC_IMG_ID+dynamiccnt);
rimg.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View view) {
flag="";
ClickListener(view);
}
{
}});
//lptvText_Property.addRule(RelativeLayout.CENTER_VERTICAL);
addtext=new EditText(this);
addtext.setId(DYNAMIC_TEXT_ID+dynamiccnt);
addtext.setBackgroundColor(Color.rgb(230,230,230));
addtext.setTextColor(Color.rgb(255,140,0));
addtext.setHeight(300);
//addtext
recipelinear.addView(rimg, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recipelinear.addView(addtext, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
recipelinear.addView(addbtn);
}