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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:50:51+00:00 2026-05-15T15:50:51+00:00

I have an app that requires scrollbars to be enabled in one landscape orientation

  • 0

I have an app that requires scrollbars to be enabled in one landscape orientation but not in portrait orientation. I thought the easiest way to do this would be to make an attribute indicating whether the scrollbar is enabled or not, such as the following:

<ScrollView
        a:layout_width="fill_parent"
        a:layout_height="fill_parent"
        a:scrollbars="?my_activity_scrollbars"
        a:fadingEdge="none"
        >

I would then define separate values of the attribute for landscape and portrait modes. Seemed easy.

So I then defined this attribute in attrs.xml:

<resources>
  <declare-styleable name="Theme">
    <attr name="my_activity_scrollbars" format="enum" /> 
  </declare-styleable>
</resources>

And added it to my app’s styles.xml:

<style name="MyApp" parent="@android:style/Theme.Light">
    <item name="add_credit_card_scrollbars">none</item> 
</style>

However, when I try to compile my app, I get the following error:

styles.xml:8: error: Error: String types not allowed (at 'my_activity_scrollbars' with value 'none').

It seems clear that it’s treating “none” as a string rather than an enumerated value. Rather than using “none” I tried things like “?android:attr/scrollbars/none”, “?android:attr/none”, etc, but those didn’t work.

How can I specify the “none” value as an enumerated value instead of a string?

  • 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-15T15:50:52+00:00Added an answer on May 15, 2026 at 3:50 pm

    I believe you have your attr definition set incorrectly:

    This is an attr enum from the android source:

    <attr name="ellipsize">
        <enum name="none" value="0" />
        <enum name="start" value="1" />
        <enum name="middle" value="2" />
        <enum name="end" value="3" />
        <enum name="marquee" value="4" />
    </attr>
    

    It appears you do not define format="enum" and instead specify the enum values within the attr tag itself.

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

Sidebar

Related Questions

I have an app that needs to open a new window (in the same
I have an app that executes commands on a Linux server via SSH just
I have a app that I'm deploying to a development server using Capistrano. I'd
I have an app that is failing on the install. The vendor says I
I have an App that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential my
I have an app that needs to handle very large strings between a SQL
I have an app that I'm writing a little wizard for. It automated a
I have an app that lets the user search over a number of fields
I have an app that is a combination of asp/asp.net, and both sides depend
I have an app that I've written in C#/WinForms ( my little app ).

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.