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

  • Home
  • SEARCH
  • 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 7603267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:37:07+00:00 2026-05-30T23:37:07+00:00

I have a TextView in a FrameLayout as follows: <FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" … >

  • 0

I have a TextView in a FrameLayout as follows:

<FrameLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    ... >
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true"
        ... />

The text of the TextView is set in code and I have a translate animation running on the TextView that slides it left across the parent View as follows:

myTextView.setText(getVenueInformationText());
myTextView.setAnimation(AnimationUtils.loadAnimation(myContext, R.anim.slide_left_repeatedly));

I need to cater for both the cases where the text in the TextView is shorter or wider than the width of the parent View (FrameLayout in this case) . However, I am finding that the width of the animated TextView is only ever as wide as the FrameLayout (and thus my text is chopped).

Does anyone know why, when I set the text on my TextView and set the animation, the TextView appears only ever as wide as the FrameLayout (even if the text in the TextView should stretch it to be wider than the FrameLayout)?

Note 1: A marquee animation on the TextView won’t do the job for me as it is possible for the text in the TextView to be smaller than the width of the parent View (in which case the marquee animation does not run… and I need the animation to run regardless of the text’s width).

Note 2: Below is the xml definition of the translate animation I am using:

 <translate
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/linear_interpolator"
  android:fromXDelta="100%p"
  android:toXDelta="-100%"
  android:repeatCount="infinite"
  android:duration="15000" />
  • 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-30T23:37:08+00:00Added an answer on May 30, 2026 at 11:37 pm

    Solved it by putting my TextView in a HorizontalScrollView (instead of a FrameLayout or LinearLayout) as follows…

    <HorizontalScrollView
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:paddingLeft="10dp"
      android:paddingRight="10dp"
      android:scrollbars="none" >
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:singleLine="true" />
    </HorizontalScrollView>
    

    … and then setting the text and animation of the TextView programmatically/dynamically as before.

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

Sidebar

Related Questions

I have the following TextView in my XML layout file:- <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:text=@string/autolink_test
I have the following layout in my xml file: <RelativeLayout android:layout_width=fill_parent android:layout_height=fill_parent> <FrameLayout android:id=@+id/logoLayout
I have app widget with TextView in it. <FrameLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent >
I have an empty TextView set for my ListView . When there is no
I have a custom Dialog that contains only a TextView to display some text
I have created an App Widget for Android 1.5. It uses a TextView to
((TextView)((FrameLayout)((LinearLayout)((ViewGroup)getWindow().getDecorView()).getChildAt(0)).getChildAt(0)).getChildAt(0)).setGravity(Gravity.CENTER); I have used this above code for aligning my title of activity in
I have a textview with a large text, and I would like to find
I have this custom layout: - LinearLayout - FrameLayout - ImageView - TextView This
I have Tab Layout that contains a TextView. I'd like to assign some text

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.