Now write an XML which defines a textview, need to write a class that is loaded dynamically Textview, which need to write a method that has an adaptive layout features, if a page needs a textview, then call the method, Automatic layout of the textview centered at the bottom; If a page requires two textview, call the method, the automatic layout of these two textview also centered on the bottom, and so on. How to do ah, more challenging, which Great God help? ? ?<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply: Then you absolutely need to define textview custom textview directly in the program is not on the line in xml
Reply: cited a floor qingqing_benniu reply: that you totally do not need to define textview in xml custom textview not directly on the line in the program it < / fieldset> Ah, because the project has a good number of pages are used, if the custom textview in the program code redundancy, then it is too big, now is the only package in order to avoid this kind of an XML document, reserved interface easy to use Reply: Here you can put a horizontal listview, and then do an adapter element is textview. That's it. Reply: reference to the third floor u011729265 reply: where you can put a horizontal listview, and then do an adapter element is textview. That's it. That is not the case, I wrote a listview inside the class, and then made the adapter, load the textview after coming out to the listview and then loaded into the main layout of the inside? ? Reply: references, 4th Floor linglinggg reply: Quote: references to the third floor u011729265 reply: Here you can put a horizontal listview, and then do an adapter element is textview. That's it. That is not the case, I wrote a listview inside the class, and then made the adapter, load the textview after coming out to the listview and then loaded into the main layout of the inside? ? Well, yes. Main layout put listview. But generally listview is bristling. Reply: TextView in LinearLayout, the setting gravity to the bottom of the center just fine. Put sideways or vertically in a row put a column just to you, but also can be arranged in the form of grids. Reply: reference to the 6th floor tantahe reply: TextView in LinearLayout, the setting gravity to the bottom of the center just fine. Put sideways or vertically in a row put a column just to you, but also can be arranged in the form of grids. Now just do not know how to put a row can remain centered, because there is only one Textview XML template, all other Textview displayed to load this one Textview ID assigned different values, and then in the code are provided for each display Textview position, this is not ah Reply: Do not set the display position for each TextView, as I said, the first load a LinearLayout, then add TextView in LinearLayout inside. Set LinearLayout attribute can make text centered.
No comments:
Post a Comment