开发者

Android Layout ListView

开发者 https://www.devze.com 2023-02-14 16:01 出处:网络
I need following layout for my application: <TextView/>开发者_如何学C; <ListView/> <Button/>

I need following layout for my application:

<TextView/>开发者_如何学C;
<ListView/>
<Button/>

But in this layout only ListView has a scrollbar.

I need Scrallbar for all page and don't need it for ListView. Is it possible?


Why don't you use something like this:

ListView myListView = new ListView (this);

TextView myTextView = new TextView (this);
myTextView.setText ("Your text");
…       // setup whatever else you need
Button myButton = new Button (this);
…       // setup button text, callback, whatever

myListView.addHeaderView (TextView);
myListView.addFooterView (myButton);

With the following layout:

<ListView />

This adds a fixed view to be displayed at the top and bottom of the ListView, regardless of the contents of the ListView. See the reference for these methods.

0

精彩评论

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