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 8022413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:15:43+00:00 2026-06-04T22:15:43+00:00

My listitem.xml: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android style=@style/f_w android:layout_height=60sp android:padding=0sp> <TextView android:id=@+id/con_name android:textSize=16sp style=@style/w_w

  • 0

My listitem.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/f_w" android:layout_height="60sp" android:padding="0sp">
<TextView android:id="@+id/con_name"
    android:textSize="16sp"
    style="@style/w_w" />
<TextView android:id="@+id/con_time"
    android:textSize="13sp" 
    android:textColor="#565"
    style="@style/w_w" />
</RelativeLayout>

So, I want to specify textColor of my textviews on item pressed. I’m using custom listview via baseadapter.

  • 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-06-04T22:15:45+00:00Added an answer on June 4, 2026 at 10:15 pm

    Create a selector for your TextView text color.

    res/color/list_item_text_color_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">  
        <item android:state_enabled="false" android:color="@color/disabled_color"/>
        <item android:state_focused="true" android:state_pressed="false" android:color="@color/focused_color" />
        <item android:state_pressed="true" android:color="@color/pressed_color" />
        <item android:color="@color/normal_color" />
    </selector>
    

    res/layout/listitem.xml

    <TextView android:id="@+id/con_name"
        android:textSize="16sp"
        android:textColor="@color/list_item_text_color_selector"
        style="@style/w_w" />
    

    If you want this to apply to both TextViews, you can add it in @style/w_w and remove the android:textColor part from your TextView.

    <style name="w_w">
        ...
        <item name="android:textColor">@color/list_item_text_color_selector</item>
        ...
    </style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my list layout: <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <LinearLayout
I wanted to update my layout from <?xml version=1.0 encoding=utf-8?> <TextView xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent
This is a piece of my XML document: <?xml version=1.0 encoding=UTF-8?> <catalog> <mfVictor> <decal>
This is the code.. string.xml <?xml version=1.0 encoding=utf-8 ?> - <resources> - <string-array name=countries_array>
I followed the tutorial at: http://mobile.tutsplus.com/tutorials/android/android-listview/ and was able to successfully run the application.
I am using a ListView as shown below in filename browse.xml. <ListView android:id=@+id/listView1 android:layout_width=250dp
I have some XML with <ListItem> elements, and I'd like to wrap any consecutive
I am attempting to get a Select List from an XML string... <?xml version=1.0
I need a listitem in my asp.net dropdownlist that has a value of 0
I have the following code: foreach (ListItem item in check.Items) { if (item.Selected) {

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.