开发者

Creating new params in the Code is not working?

开发者 https://www.devze.com 2023-03-11 16:56 出处:网络
This chunk of code doesnt seem to be doing its job. line=(ImageView)findViewById(R.id.imageView1); RelativeLayout.LayoutParams params==(RelativeLayout.LayoutParams)line.getLayoutParams();

This chunk of code doesnt seem to be doing its job.

line=(ImageView)findViewById(R.id.imageView1);
RelativeLayout.LayoutParams params==(RelativeLayout.LayoutParams)line.getLayoutParams();
params.addRule(RelativeLayout.BELOW, R.id.minSpinner开发者_运维百科);
line.setLayoutParams(params);

**Note all of these have been instantiated just not doing there job when put into emulator. The line is supposed to move BELOW the Spinner. Thanks in advance


Change the == to =?

RelativeLayout.LayoutParams params==(RelativeLayout.LayoutParams)line.getLayoutParams();


Have you tried quickly implementing the layout in XML to make sure that BELOW is actually functioning as you're expecting? Relative layouts can be tricky to figure out without some trial and error.

0

精彩评论

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