I am trying to understand how to animate a ViewGroup which is larger
than the screen extents
such that it is not clipped to the screen extents. Below is a simple
but unsuccessful example
attempting to accomplish this. Specifically, I expected the line
"myTable.setClipChildren(false);"
to accomplish the desired result, but it did not produce any change
from the attempt without it.
HelloTableLayout.java:
package com.example.hellotablelayout;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.animation.RotateAnimation;
import android.widget.TableLayout;
public class HelloTableLayout extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
LayoutInflater vi = (LayoutInflater)this.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
TableLayout myTable = (TableLayout)
vi.inflate(R.layout.main, null);
myTable.setClipChildren(false);
setContentView(myTable);
RotateAnimation rotate = new RotateAnimation(
0, 360, RotateAnimation.RELATIVE_TO_SELF,
0.5f,
RotateAnimation.RELATIVE_TO_SELF, 0.5f);
rotate.setDuration(5000);
myTable.startAnimation(rotate);
}
}
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="576dip"
android:layout_height="576dip"
android:id="@+id/mytable"
>
<TableRow>
<ImageView
android:layout_column="0"
android:src="@drawable/blanktile" />
<ImageView
android:layout_column="1"
android:src="@drawable/blanktile" />
</TableRow>
<TableRow>
<ImageView
android:layout_column="0"
android:src="@drawable/blanktile" />
<ImageView
android:layout_column="1"
android:src="@drawable/blanktile" />
</TableRow>
</TableLayout>
"blanktile.png" is a dummy 288x288 pixel image.
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
To unsubscribe from this group, send email to
android-beginners+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.