Hy!
I've created a button on android in which the text looks like this: http://i51.tinypic.com/2u4oaww.png
It looks like this because the activity is in landscape
mode.What I want next is to rotate the text on the button for it to look normally, but I can figure out how this could be done.
I tried with animation, like this:
In res/anim/myanim.xml
:
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="180"
android:pivotX="50%"
android:duration="0" />
takePhoto = (Button) findViewById(R.id.btnPhoto);
takePhoto.setText(t);
RotateAnimation ranim = (RotateAnimation)AnimationUtils.loadAnimation(this, R.anim.myanim);
ranim.setFillAfter(true);
takePhoto.setAnimation(ranim);
But when I do this my button
won't appear on the screen no more!
Could someone tell me how could I fix that?Thanks
EDIT:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:layout_weight="1.0">
<SurfaceView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/surface_camera"
/>
</LinearLayout>
<LinearLayout android:layout_width="90dip"
android:layout_height="fill_parent">
<Button
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/btnPhoto"
android:text="Take Photo"
android:layout_gravity="bottom|left"
/>
</LinearLayout>
</LinearLayout>