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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:06:04+00:00 2026-05-15T19:06:04+00:00

I have a gallery with the TextView to achieve the segment controller on the

  • 0

I have a gallery with the TextView to achieve the segment controller on the image below. I can achieve it by the ApiDemo’s Gallery Example but I am lagging on the look and feel of the gallery.

I want to do the backgrounds, Selected/deselected and selected item won’t be cone to the center of the screen.

Any Idea or Articles are most Thankful.

image http://www.freeimagehosting.net/uploads/cce47da969.png

I have tried to get using 2 ways. that are:

  1. Gallery View
  2. horizontal ScrollView

The ouput getting is in the below image:

image http://www.freeimagehosting.net/uploads/b4c1be5924.png

I have Problem on Both to get the proper output.

In Gallery View,

  • can not Change Background of Selected
    Item.and make it us rounded corner.
  • Selected Item comes to the center horizontal of the Screen Automatically.

In horizontal View,

  • More Complicated when the textView‘s number is large.
  • Can not find a way similar to On Click Item. if i have use switch case. the previous problem comes again.
  • 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-15T19:06:05+00:00Added an answer on May 15, 2026 at 7:06 pm

    place this in drawables text_selector.xml

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/round" />
        <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/round" />
        <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/round_selected" />
        <item android:drawable="@drawable/round" />
    </selector>
    

    round.xml

        <?xml version="1.0" encoding="UTF-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
         android:shape="rectangle"> 
         <gradient android:startColor="#FFEF95" android:endColor="#FFEF95"   
                android:angle="270"/> 
    <corners android:bottomRightRadius="14dp" android:bottomLeftRadius="14dp" 
         android:topLeftRadius="14dp" android:topRightRadius="14dp"/> 
    
    </shape>
    

    round_selected.xml

    <?xml version="1.0" encoding="UTF-8"?> 
    <shape xmlns:android="http://schemas.android.com/apk/res/android" 
         android:shape="rectangle"> 
         <gradient android:startColor="#F6A110" android:centerColor="#FFEF95" android:endColor="#F6A110"   
                android:angle="270"/> 
    <corners android:bottomRightRadius="14dp" android:bottomLeftRadius="14dp" 
         android:topLeftRadius="14dp" android:topRightRadius="14dp"/> 
    
    </shape>
    

    And here is the textview to inflate

     <TextView    
            android:id="@+id/perioxi_select" 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Select Area"
             android:gravity="center_vertical|center_horizontal"
             android:background="@drawable/text_selector"
             android:minHeight="60dp"
             style="@style/FirstText"   
             android:layout_weight="1"
            />
    

    Get the style too. should be placed inside res/valus/styles.xml

    <?xml version="1.0" encoding="utf-8"?>
    <resources> 
     <style name="FirstText"> 
            <item name="android:colorForeground">#f0f</item> 
            <item name="android:padding">4sp</item> 
            <item name="android:textSize">15sp</item> 
            <item name="android:textColor">#CC3300</item> 
            <item name="android:gravity">left</item> 
            <item name="android:typeface">monospace</item> 
            <item name="android:textStyle">bold</item> 
            <item name="android:colorBackground">#999</item> 
        </style> 
      </resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a url like this http://example.com/blog/photos/photos/gallery/image/1 . And i need to remove the
Suppose we have classes Gallery and Image. There can be many images in one
I have photo gallery code that does image re-sizing and thumbnail creation. I use
Hi I have a gallery in my app which shows the image in an
Jquery, AJAX and URL changes... I have a gallery, and when the image change
I have an image gallery that I created by reading the contents inside a
I have a Gallery of views that contain a TextView Label and then a
I have gallery widget, when you scroll it, currently selected image has border -
I have gallery where user can submit Youtube links to videos and server fetches
I have a Gallery with text items. I can change the selected item with

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.