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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:54:40+00:00 2026-06-13T06:54:40+00:00

I am display a layout with fade animation by manipulating its alpha levels using

  • 0

I am display a layout with fade animation by manipulating its alpha levels using AlphaAnimation.

The current solution works fine on two of my devices which use Gingerbread and one which uses Froyo. However, it does not work on Ice Cream Sandwich?!

Here is my xml layout.

<LinearLayout
        android:id="@+id/photoOptionBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:alpha="0"
        android:background="@color/gpsBackground"
        android:orientation="horizontal">

        <ImageButton
            android:id="@+id/displayShareBtn"
            style="@android:style/Widget.Holo.Button.Borderless.Small"
            android:background="@android:color/transparent"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|center_horizontal"
            android:padding="20dp"
            android:src="@drawable/share"
            android:contentDescription="Share the picture"/>

        <ImageButton
            android:id="@+id/displayDiscardBtn"
            style="@android:style/Widget.Holo.Button.Borderless.Small"
            android:background="@android:color/transparent"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|center_horizontal"
            android:padding="20dp"
            android:src="@drawable/contentdiscard"
            android:contentDescription="Discard Picture"/>

    </LinearLayout>

Here is my onCreate method to set the alpha to 0 on loadup as when done in xml it doesn’t work…

    AlphaAnimation alpha = new AlphaAnimation(0.0F, 0.0F);
    alpha.setDuration(0); // Make animation instant
    alpha.setFillAfter(true); // Tell it to persist after the animation ends
    // And then on your layout
    this._photoOptionsBar.startAnimation(alpha);

And then when I want to show it I call the following.

public void showOptions() {
        AlphaAnimation alpha = new AlphaAnimation(0.0F, 1.0F);
        alpha.setDuration(PhotoDisplayFragment.FADE_DURATION); // Make animation instant
        alpha.setFillAfter(true);
        this._photoOptionsBar.startAnimation(alpha);
        this._optionsShowing = true;
}

When I load it up in IceCream sandwich the LinearLayout is there because you can click the buttons and it executes their function, and the functions to show are being called but I just can’t see it!

Any help would be great

  • 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-13T06:54:41+00:00Added an answer on June 13, 2026 at 6:54 am

    The problem is with android:alpha=0 in the Linear Layout. To make things work you have to set visibility property to invisible in layout xml. And before starting alpha animation call setVisibility(View.VISIBLE)

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

Sidebar

Related Questions

My linear layout has two views: Custom View that display dynamic stuff One button
How may I display two images on a website with elastic layout, side by
Good evening! I want to display a uncommon layout into a HTML Textfield, using
I'm trying to create a layout with display: table and alike, but it seems
I have a partial that I want to display in a layout only when
I have a layout like this in which I want to display a label
I am trying to reuse the header layout for contact details display view. I
I am having trouble creating a layout for a dialog I want to display
<s:decorate template=/layout/display-text.xhtml> <h:selectOneRadio layout=pageDirection value=#{_userHome.pref}> <f:selectItems value=#{_userHome.getPreferences()} /> </h:selectOneRadio> </s:decorate> I am able to
I want my textarea controls to follow standard block display layout behavior, so that

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.