I have the xml layout, and I want to create View from it - I need do it programatically. Is it possible?
2 Answers
yes It is. you have to use the inflater service like
LayoutInflater li=(LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
yourview=li.inflate(R.layout.yourlayout, null);
2 Comments
user1023177
Thank you. How can I set width and height for my new view?
Blackbelt
with layoutparams. take a look to the documentation.