Sory I can't describe a right title for my question,
I want to create listview something like this
In top of list view on screen look like
and when user scroll the list in screen will be like this
and in end of list is
I have 3 picture for top list, middle and bottom list.
I already try to add header and footer for top image and bottom image but looks like the picture is inside the list view
I try to create vertical linear layout and put picture top,middle and bottom in sequence but still not get result that i expected
Do anyone have a suggestion for listview like this
Don't set your frame background for entire listview or its parent. Instead first slice your frame background into three parts, (i) topframe (ii) middleframe (iii) bottomframe. Now create a custom listview and set background for each and every list rows.
In order to achieve your design, you need to find the first and last item of list and set topframe for first row and bottomframe for last row , all the other rows background should be middleframe.
Related
I have a listView that is populate via a RSS feed. The height of each item on the ListView can vary depending on the length on the content. Is there a way to only add enough items to the listView to fill the screen (the listView has a fixed height).
For example if each item only has one line of text I can fit 7, but if they have two lines of text I can only fit 5. I want to be able to programmatically decide when to stop adding items. I don't want the ListView to have to scroll.
EDIT
Let me rephrase. I don't want to just solve it but scrolling down. There may at some point in the development be content that gets added below the screen and requires scrolling but even in that case I don't want half an item showing at the bottom. Basically I don't want broken/half items showing at the bottom, if it's on the screen it should be the whole item that is showing. If not it should be below the bottom of screen.
Try using a normal Linear Layout and when adding the inflated row, override the onMeasure to know if it fits on the screen.
I'm implementing the UI like the picture below. I'm using gridview to this layout. When user tap the item in gird. It show a circle overlap to the other item. I don't how to do it. at first I define a layout with the circle is gone and add onclicklistener. If user tap on that, I visible the circle, but the size of gridview also extend. Can you help me provide solution?
You can add this views in gridview parent layout preferable relative layout. You must add them after your grid view initsialisaton is done and onitemclick listener on grid item to make them visible. Exactly the one you've tryed but not in grid view but in the activity rootlayour.
As Shown in image 1: I have listview with 2 items(half empty),and at the top i have one serch box I complete search functionality with custom adapter and Filterable but i want some other thing with this .they are
want to scroll listview with half empty(By Default it scrollable when Items more than area)
Search box should also scroll with listview.(As shown in 2 picture.)
listview should be scroll up to last item (Here last item is Item2 should always shown )and item at top should highlighted with different color.
Scrollview can have only one direct child. So if you want to put more than one view in a single scrollview, you should put all the views you need to scroll, inside single container view eg:-linear layout and put those views in that.
I'm an Android newbie. I want to create a screen with some expandable headers as illustrated. I've created the 1st row "gff" as shown.
However, each row under gff shows a space in between rows. Also, the ListView does'nt fill the width of the screen and leaves a margin on the sides and above.
How can I get the header and caption to fill the entire length of the screen as shown in the diagram? Also, how can I get the rows to show a different color?
Is there an example or code that does something similar?
Try setting divider of ListView to null, like listView.setDivider(null), this should help. Also you can set listView.setSelector(null) this should remove unnecessary margins.
I've been trying to get this working for some time... Is there any way to put a transparent fixed header on a listview, so it looks kind of like this:
As you scroll up, the header will eventually be a regular header with item 1 below it.
I guess I'll have to implement onScrollListener and do something like when the first visible item is item 2 in the list, start moving the listview margins by 1 pixel, until it is below the header? Or are there better ways? Any ideas on how one would do something like that?
I would make a FrameLayout... and put your ListView in it first, filling the screen. Then put a TextView on top of that. To get the desired behavior at the top, maybe have a blank element at position 0 of the list, or just make the top padding of list item 0 have the height of your header...
Does that make sense? The ListView should scroll underneath the TextView in a FrameLayout.
You can use a RelativeLayout for that, so you can get the Z axis using some properties;)
Update:
For example using a RelativeLayout:
RelativeLayout
----ListView
----TransparentHeader
Will appear in the way you show on your image.
As a comment :Android put layout elements in the order that they are defined on your xml, so, widgets at the bottom of the layout will be at the top.