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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:06:44+00:00 2026-05-25T21:06:44+00:00

I am experiencing some problem that I basically dont know how to fix. I

  • 0

I am experiencing some problem that I basically dont know how to fix. I have a LinearLayout with some child compenents in it, like ImageView, TextView and so on, one example can be seen in the xml below:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" 
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
style="@style/list_buttom_top">

<LinearLayout android:gravity="center_vertical"
    android:paddingLeft="10dip" 
    android:orientation="vertical"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_weight="1.0">

    <TextView android:text="title" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/title"
        style="@style/content_page_large_text" />

    <TextView android:text="summary" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" 
        android:id="@+id/subtitle"
        android:visibility="visible" 
        style="@style/content_page_small_text" />
</LinearLayout>

<TextView android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:id="@+id/itemCount"
    android:visibility="gone" 
    style="@style/content_page_large_count_text" />

<ImageView android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    android:id="@+id/chevron"
    style="@style/list_buttom_chevron" />

</LinearLayout> 

The style list_buttom_top says that when the LinearLayout is in the pressed state, the background color needs to be changed, and so far this is working. The problem is that the content_page_large_text also says that the text color of the TextView needs to be changed as well, but it doesnt happen. The only color changing when I am clicking the LinearLayout is its background.

<style name="list_buttom_top">
<item name="android:clickable">true</item>
<item name="android:paddingTop">10dip</item>
<item name="android:paddingBottom">10dip</item>
<item name="android:paddingLeft">10dip</item>
<item name="android:paddingRight">10dip</item>
<item name="android:gravity">center_vertical</item>
<item name="android:background">@drawable/background_view_rounded_top</item>
</style>

<style name="list_buttom_chevron">
    <item name="android:paddingLeft">4.0dip</item>
    <item name="android:paddingTop">2.0dip</item>
    <item name="android:paddingRight">4.0dip</item>
    <item name="android:paddingBottom">2.0dip</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:src">@drawable/chevron</item>
</style>    

I have tried using this android:duplicateParentState=”true” in my TextViews but it also didnt work. The same happens for the ImageView, which does not get its source image changed when I am clicking the LinearLayout.

Am I missing something here?
Thanks for the attention
T

  • 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-25T21:06:44+00:00Added an answer on May 25, 2026 at 9:06 pm

    It would be an easier issue to track if we could see your content_page_large_text style. Also, I don’t see how you’re actually setting the color, is your background_view_rounded_top a <selector> element or are you setting it in a listener in the activity?

    But yeah I also recently discovered that android:duplicateParentState=”true” isn’t the panacea that I thought it was.

    Should those two solutions be exhausted then my go-to solution usually is a custom component for the root layout.
    http://developer.android.com/guide/topics/ui/custom-components.html
    But that might not be necessary if the interface is this simple. I’m pretty sure you can do this with StateListDrawables.

    Custom components are usually easier than trying to find the magic combination of xml variables, and will make the layout more understandable/editable later if you’re planning on making this more complicated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm debugging a service that's experiencing some problems on start-up. To aid me in
I am experiencing a problem with the following code in some versions of Internet
Our team has been experiencing a recurring problem with velocity templates. Upon rendering, some
I have been developing some computer vision tools with openCV, but every time that
I'm experiencing an intermittent problem with a class that extends javax.swing.text.DefaultStyledDocument . This document
I have an outlook addin that I have been developing for some time now,
I'm experiencing some problem when I compile some legacy apps on VB6 since I
I have some 3D models that I render in OpenGL in a 3D space,
Hi I was wondering if anyone con shed some light with a problem that
We are experiencing a difficult problem which has been puzzling us for some time.

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.