adding a shape using java code, in middle of a xml layout?
As my requirement I need to add a shape in middle of an existed xml layout using Java code. In that xml I have a graph title at the top, under that I have some text details. Up to now I am able to draw that shape under the graph title, i.e where I wa开发者_StackOverflownt to place in xml, by using the following code.
linear =(LinearLayout) findViewById(R.id.linear);
RectangleView aView = new RectangleView(this);
linear.addView(aView);
But the problem is, after adding the shape, remaining ui of that xml (other textual details) is gone. I want to place that thing also in my xml. If any one is aware of this, can you please suggest me how to fix this? Any response will be appreciated.
First Create a layout with nested layouts and then add the shape to the layout inside the first one,
精彩评论