android - Wrapping a LinearLayout from xml -


I'm trying to create some Android view classes (which are wrappers only around the layout defined in XML file) Correct:

  Public Square MyViewWrapper LinearLayout Expanded {Private TextView mTextView; Public MyViewWrapper (reference reference) {super (reference); } Public Construction UI () {LayoutInfleter Inflator = (LayoutInflator) getContext (). GetSystemService (References LAOUT_INFLATER_SERVICE); Inflater.inflate (R. layout.mayview, this); MTextView = (TextView) findViewById (R.id.myview_textview); }}  

So it is an idea that I can create my thoughts in such a way, and they have reason to modify their child's ideas. The layout looks like this:

  & lt; LinearLayout & gt; & Lt; TextView / & gt; & Lt; / LinearLayout & gt;  

It looks like I'm going to get an extra unnecessary liner layout. The wrapper class itself is a LinearLayout, and then it will add the internal linear layout to the xml file.

Is that okay?

Thanks

You & lt; LinearLayout & gt; in your layout file & lt; Merge & gt; Try changing with . I have not tried to do this recently, and I feel that when I tried for the last time, I get problems, but in principle the objective should be fulfilled. & lt; Merge & gt; is basically "take all my children and put them in whatever container they are being inflated".


Comments

Popular posts from this blog

MVP, design question -

excel - Populate list via a bi-Condition -

iphone - How do I make a UIPickerView in a UIActionSheet -