开发者

Tab without internal scroll

开发者 https://www.devze.com 2023-02-06 23:02 出处:网络
I have a Cont开发者_如何学JAVAenView with a LinearLayout containing a few TextViews and then a TabHost.

I have a Cont开发者_如何学JAVAenView with a LinearLayout containing a few TextViews and then a TabHost. The TabHost has 3 tabs which may contain a ListActivity with many items, and thus require scrolling.

Currently the FrameLayout automatically gets a vertical scrollbar, but I want to have a scrollbar on the main view.

Ie. when I scroll down to view the rest of the ListActivity in my current tab I want the TextView above the tab to scroll out of sight.

Any ideas?

Take a look at this screenshot I made to clarify. The left screen is how it currently is. The right one is photoshopped to what I want to achieve.

Tab without internal scroll


solved it using a workaround not requiring internal scroll


To my knowledge you cannot do this with a tabhost. You might want to reconsider how your layout is designed, this is how I would approach this problem:

1 ListView with 2 headers
Header 1 : your textviews
Header 2 : 3 tab like buttons

With the three tab like buttons you can control the content that is displayed in the list like it is a tabhost. This way the scroll bar will display the way you want it to.

0

精彩评论

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