How can I make the first visible element of the ListView having a different layout from the others.


I have created a custom adapter with 2 different layouts. Now, how can I make the layout change when the item comes in the first position?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
to get the the first item of the listview having a different layout the following code can be used. But the listview don’t move when the items in the list are less than the no of visible items.
and inside the adapter class check if the
postionis same asfirstItemif its equal then show the detals layout.