开发者

Android linearLayout problem

This is my first post here, I was stuck with linearlayout, I have linearlayout(horizontal) 开发者_C百科 with 3 buttons in it of which I set the third button layout_weight=1 so it takes up the whole space in linearlayout this is pretty much working properly.

But when I put this layout in HorizontalScrollview the weight property doesnt works for me, what I want is to display two button horizontally on whole screen width and when scrolled third button should appear taking up the whole width of screen hiding both the buttons but its not happening.

Regard's Saurabh Agnihotri


you cant do it with horizontal scroll view. You can do one thing.. take a view flipper and take two layout in it. in one layout there will be two buttons by giving its weight as 1. and in the second layout put a button and give its width as fill_parent. Then use gesture listener to move the view flippers layouts. Then it will look like horizontal scroll view.


You could also remove the linear inside the horizontal and put a table instead with three buttons in one row and two blanks in another so the table sees the third as overflow and feels the need to scroll... You will prbably need to mess around with weights but should work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜