android - How to add linear layout dynamically to relative layout in a fragment which itself a part of tablayout? -
i couldn't find answer question, please can me this, here scenario (graphically) scenario
apply them in fragment class
public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.<fragment_xml_name>, container, false); relativelayout rl = (relativelayout)rootview.findviewbyid(r.id.<yourlayoutid>); linearlayout ll = new linearlayout(getactivity().getapplicationcontext()); textview tv1 = new textview(getactivity().getapplicationcontext()); textview tv2 = new textview(getactivity().getapplicationcontext()); //do confs textviews... ll.addview(tv1); ll.addview(tv2); rl.addview(ll); return rootview; }
Comments
Post a Comment