Reputation: 2305
Another problem that I encountered today... I am looking for something similiar to flowLayout from swing, I was looking and found nothing... I need some layout inside which I am gonna place 3 buttons, when there is not enough space ( In potrait mode for example) I want them to be shown like one button above taking 100% space of layout, the other two just under the first, when there is enough space (landscape mode) I want them to be placed with the same weights in one line.I thought about relative layout but it misses weight, linear layouts on the other hand doesnt fit my requirements from what I have read.
Upvotes: 0
Views: 64
Reputation: 5415
What you could try is overriding the onConfigurationChange method of the activity and try implementing some logic there to change the position of the views depending on the orientation of the device. Or in your oncreate you could instantiate all your views and hide a complete set of controls for one type of orientation and then on another type do the opposite. Ive done both of these and hiding and unhiding the views seemed to be the least performance taxing because everything was instantiated once in oncreate. You could also try using seperate layouts all together for each orientation which might decrease performance due to view inflation but if your views are not to complex you might not notice anything except on lesser devices.
Upvotes: 1