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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:49:20+00:00 2026-06-03T05:49:20+00:00

I am using a translate animation to move an egg(ImageButton) outside of the carton(ImageView),

  • 0

I am using a translate animation to move an egg(ImageButton) outside of the carton(ImageView), but it is consistently clipping, so I looked all over stackoverflow to find a solution, but after trying to implement all the solutions, it is still clipped.

Can anyone shed some light onto why mine is still clipping, here is the XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:gravity="top" 
  android:clipChildren="false"
  android:clipToPadding="false" 
  android:layout_height="match_parent">
<ImageButton 
  android:id="@+id/imageButton1" 
  android:background="@drawable/transparentblackbackground" 
  android:layout_below="@+id/relativeLayout1" 
  android:layout_height="match_parent" 
  android:layout_width="match_parent"
  android:clipChildren="false" android:clipToPadding="false" >
</ImageButton>

<!-- Total Carton for Animation -->
<RelativeLayout
    android:orientation="vertical"
    android:layout_width="440dp"
    android:id="@+id/opencarton" 
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:clipChildren="false"
    android:clipToPadding="false" >



    <!-- The carton that holds the eggs -->
    <RelativeLayout 
        android:orientation="vertical"
        android:layout_width="260dp"
        android:id="@+id/opencarton" 
        android:layout_height="512dp"
        android:layout_centerInParent="true"
        android:clipChildren="false"
        android:clipToPadding="false">

        <ImageButton 
          android:id="@+id/blackbgnd" 
          android:background="@drawable/clearbackground"
          android:layout_height="600dp" 
          android:layout_width="400dp"
          android:clipChildren="false" 
          android:clipToPadding="false"
          android:gravity="center">
        </ImageButton>

        <!-- Top of Carton image -->
        <ImageView 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:id="@+id/topcomponent" 
            android:src="@drawable/topofcarton" 
            android:layout_alignParentTop="true" 
            android:layout_alignParentRight="true"
            android:clipChildren="false"
            android:clipToPadding="false">
        </ImageView>

        <!-- First Row Of eggs goes here in future -->    
        <ImageButton android:clipChildren="false" android:clipToPadding="false" android:layout_height="158dp" android:id="@+id/egg1" android:background="@drawable/goldegg" android:layout_width="79dp" android:layout_alignTop="@id/topcomponent" android:layout_alignParentLeft="true" android:layout_marginLeft="10dp" android:layout_marginTop="3dp"></ImageButton>
        <ImageButton android:clipChildren="false" android:clipToPadding="false" android:layout_height="158dp" android:id="@+id/egg2" android:background="@drawable/goldegg" android:layout_width="79dp" android:layout_alignTop="@id/topcomponent" android:layout_alignParentLeft="true" android:layout_marginLeft="90dp" android:layout_marginTop="3dp"></ImageButton>
        <ImageButton android:clipChildren="false" android:clipToPadding="false" android:layout_height="158dp" android:id="@+id/egg3" android:background="@drawable/goldegg" android:layout_width="79dp" android:layout_alignTop="@id/topcomponent" android:layout_alignParentLeft="true" android:layout_marginLeft="170dp" android:layout_marginTop="3dp"></ImageButton>

       ................ 

</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
  • 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-03T05:49:21+00:00Added an answer on June 3, 2026 at 5:49 am

    Ok, I wasted about one hour solving a similar problem.

    I suppose that you are animating the object “manually” using some transformations or so and calling postInvalidateDelayed() or similar to force a refresh.

    The problem is (was for me) that you need to call it on the top view, because otherwise the canvas gets clipped automatically to the item you are refreshing. So calling invalidate() (or similar) on the very top view should cause redraw with canvas that is not clipped too much.

    In your case, I noticed you have two “opencarton” ids defined, you should be probably refreshing the top one or the very top RelativeLayout.

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

Sidebar

Related Questions

We develop asp.net webforms using visual studio 2008. For multilingual support, we translate all
I'm using this animation to animate a LinearLayout, but I just cant get it
I am using a translate animation: <?xml version=1.0 encoding=utf-8?> <set xmlns:android=http://schemas.android.com/apk/res/android> <translate android:fromXDelta=-75%p android:toXDelta=0%p
I'm moving a very long image using -webkit-transform: translate(-958px, 0); animation The image gets
I am using a UIView animation to resize and translate a view containing multiple
I finally came to know that when using translate animation, the button onclick listener
I have successfully done one side animation using Translate Animation means the image goes
How can I programmatically translate an arbitrary view without using an animation ( android.view.animation.*
I have an ImageView that I am animating using a TranslateAnimation. At the end
I'm using Google Translate API, and if I try to translate Mc Donald's this

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.