Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3878140
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:34:44+00:00 2026-05-19T22:34:44+00:00

I am working on customize (inflated) list view. In which I have used the

  • 0

I am working on customize (inflated) list view. In which I have used the text and background image for text (as per the condition).
Now I am facing problem in scrolling the list view that background of text view is overlapping to the other text views.
Here is the sample code:

@Override
public View getView(int position, View convertView, ViewGroup parent) {

 View icontextlayout=convertView;
     icontextlayout= inflater.inflate(R.layout.layout_complex_list, null);
     TextView Txt1=(TextView)icontextlayout.findViewById(R.id.txt1);
if(disp1==true)
{
Txt1.setBackgroundResource(R.drawable.pic)
}
    else
Txt1.setText("Text1 "+strUser);//

    TextView Txt2=(TextView)icontextlayout.findViewById(R.id.txt2);
if(disp2==true)
{
Txt2.setBackgroundResource(R.drawable.pic);
}
    else Txt2.setText("Text2: "+strIndus);
return icontextlayout;      

}

Could you please help me out that background image pic do not overlap the others background.

Thanking you…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:34:45+00:00Added an answer on May 19, 2026 at 10:34 pm

    The problem is that you must set a default background when you don’t need a background. For instance:

    if(disp1==true){
        Txt1.setBackgroundResource(R.drawable.pic);
        Txt1.setText("");
    }
    else{
        Txt1.setText("Text1 "+strUser);//
        Txt1.setBackgroundDrawable(null);
    }
    

    Also, if you don’t mind, I like to give you my opinion about your code:

    • That’s not they way in which list are usually populated. Take a look at this answer: How to load the Listview "smoothly" in android
    • convertView is used to reuse rows. In your case you are doing something like:

    View icontextlayout=convertView;
    icontextlayout= inflater.inflate(R.layout.layout_complex_list, null);
    

    Which is bad, because you are not actually using the convertView (when you call inflater.inflate) it will create a new row, thus your list will be really slow.

    • if(disp2==true) is redundant. You should consider using just: if(disp2).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a generic sitemap working. I'm now looking to customize the output. Im
I have a nicely working custom CursorAdapter with customized ListView. This view allows the
Currently i am working on a iPhone Application Which is displaying video. I have
I am working on a model criteria builder. I have a dropdown list with
I'm working to customize liferay's Calendar portlet and have created a hook for this.
I am working on an app and want to customize the UItabbar icon image.
I'm working on a GUI application, which relies heavily on Action<> delegates to customize
I am working on Microsoft office infopath 2007.I have inserted the controls as text
I am working in Silverlight 4.0 and have created a web application which is
I am working on a customized list view here is my adapter class public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.