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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:17:07+00:00 2026-06-11T01:17:07+00:00

I uses its selection for the list <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent

  • 0

I uses its selection for the list

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/arrow"
    android:orientation="horizontal" >

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|left"
        android:layout_marginBottom="5dp"
        android:layout_marginLeft="5dp"
        android:layout_marginTop="5dp"
        android:layout_weight="1"
        android:gravity="center_vertical"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/tvDescr"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical" >
        </TextView>
    </LinearLayout>

    <ImageView
        android:id="@+id/ivImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:maxHeight="20dp"
        android:minHeight="20dp" >
    </ImageView>

</LinearLayout>

and selector arrow.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item><shape>
            <gradient android:angle="90.0" android:endColor="#6495ED" android:startColor="#0000FF" android:type="linear" />

            <corners android:radius="5.0dp" />
        </shape></item>
    <item android:state_focused="true"><shape>
            <gradient android:angle="90.0" android:endColor="#BA55D3" android:startColor="#800080" android:type="linear" />

            <corners android:radius="5.0dp" />
        </shape></item>
    <item android:state_pressed="true"><shape>
            <gradient android:angle="90.0" android:endColor="#BA55D3" android:startColor="#800080" android:type="linear" />

            <corners android:radius="5.0dp" />
        </shape></item>

</selector>

the result is

enter image description here

– does not work but if I remove (sources below) it will work

<item><shape>
                <gradient android:angle="90.0" android:endColor="#6495ED" android:startColor="#0000FF" android:type="linear" />

                <corners android:radius="5.0dp" />
            </shape></item>

enter image description here

but it does not give me the desired result, because after you click on the “list-button” style has to change – but this does not happen

I want to make:

1)Style before pressing as in the picture 1

2)After I press the button, the button style has to change as the 2 picture

3)remain that way until I click on another button
enter image description here

  • 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-11T01:17:08+00:00Added an answer on June 11, 2026 at 1:17 am

    a selector is a ‘state-list-drawable’, ie it ‘selects’ <items> depending upon the state of the view it is applied to.

    A StateListDrawable is a drawable object defined in XML that uses a
    several different images to represent the same graphic, depending on
    the state of the object. For example, a Button widget can exist in one
    of several different states (pressed, focused, or niether) and, using
    a state list drawable, you can provide a different background image
    for each state.

    Here is the syntax, as in the docs :

    <selector xmlns:android="http://schemas.android.com/apk/res/android"
        android:constantSize=["true" | "false"]
        android:dither=["true" | "false"]
        android:variablePadding=["true" | "false"] >
        <item
            android:drawable="@[package:]drawable/drawable_resource"
            android:state_pressed=["true" | "false"]
            android:state_focused=["true" | "false"]
            android:state_hovered=["true" | "false"]
            android:state_selected=["true" | "false"]
            android:state_checkable=["true" | "false"]
            android:state_checked=["true" | "false"]
            android:state_enabled=["true" | "false"]
            android:state_activated=["true" | "false"]
            android:state_window_focused=["true" | "false"] />
    </selector>
    

    notice the attributes you can set in the the <item>.

    here is an example of a typical selector..

    <selector xmlns:android="http://schemas.android.com/apk/res/android" 
    >
        <item
            android:state_focused="true" 
            android:state_pressed="false" 
    android:drawable="@drawable/list_element_focused"   />
        <item
            android:state_focused="true" 
            android:state_pressed="true"
    android:drawable="@drawable/list_element_focused_pressed"   />  
        <item
            android:state_focused="false" 
            android:state_pressed="true"
    android:drawable="@drawable/list_element_pressed"   />  
        <item
    android:drawable="@drawable/list_element_unfocused" />  
    </selector>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Android app, which uses a TabActivity to display its contents, has 4 tabs
I am writing an application that uses a UIPickerView and populates its list items
I have a page that uses the JQuery Listnav plugin ( http://www.ihwy.com/labs/jquery-listnav-plugin.aspx ). The
The encoding package uses HaXml in its build script (in Setup.hs ). It happens
I'm developing an Ncurses application that uses its own palette via init_color() (assuming can_change_colors()
I just started using Qt and noticed that it uses its own make tool,
Grails tends to write out the URL for everything that uses its tags as
I'm really confused about the visitor pattern and its uses. I can't really seem
What is WCF and WF in .NET? What are its uses? How to start
I have a website that uses JSP as its view technology (and Spring MVC

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.