Hy!
Я создал кнопку на Android, в которой текст выглядит так: http://i51.tinypic.com/2u4oaww.png
Это выглядит так, потому что действие находится в режиме landscape
. Далее я хочу повернуть текст на кнопке, чтобы он выглядел нормально, но я могу понять, как это можно сделать.
Я пытался с анимацией, как это:
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);
Но когда я это сделаю, мой button
больше не будет появляться на экране!
Может кто-нибудь сказать мне, как я могу это исправить? Спасибо
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>