开发者

Controlling problem in android layouts

开发者 https://www.devze.com 2023-04-05 13:25 出处:网络
I tried to show new view on the center of relativelayout. But the new view always places on the top of screen.

I tried to show new view on the center of relativelayout. But the new view always places on the top of screen.

LayoutInflater inflater = (LayoutInflater)this.getSystemService("layout_inflater");
dest = inflater.inflate(R.layout.searchlayout, ViewGroup)      
this.findViewById(开发者_如何学运维R.layout.pdfview));
RelativeLayout.LayoutParams params = new     RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,  RelativeLayout.LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.CENTER_VERTICAL);
dest.setLayoutParams(params);
this.addContentView(dest, params);
0

精彩评论

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