0

I have an application in android in which I'm setting the text of a button using a FrameLayout, something like:

    <FrameLayout    android:layout_width="fill_parent"
                    android:layout_toRightOf="@id/surface_camera"
                    android:layout_height="fill_parent">


  <Button           android:layout_width="match_parent"
                     android:id="@+id/btnPhoto"
                    android:layout_height="match_parent"/>
        <TextView   
                    android:layout_width="match_parent"
                    android:id="@+id/textview"
                    android:textColor="#000000"
                    android:textSize="20dip"
                    android:layout_gravity="center_horizontal|bottom"
                    android:layout_height="match_parent" 
                    android:text="Take Photo"
                    />

  </FrameLayout>

And the result looks like this: http://i53.tinypic.com/2ypgn0l.png

What I wanna ask is there any posibility that further more using this FrameLayout I could rotate this text???...Let say with 90 degrees...And if YES, how?Thank you!

adrian
  • 4,574
  • 17
  • 68
  • 119

1 Answers1

0

You could use the RotateAnimation on the TextView but if you just trying to use a different layout in landscape and portrait, specify different xmls in different folders. name the folders according to http://developer.android.com/guide/topics/resources/providing-resources.html

The above link tell how you can specify different resources for different conditions.

blessanm86
  • 31,439
  • 14
  • 68
  • 79
  • I already tried naming 2 folders layout and layout-land and defining different layouts in each two....but there is a problem.In my onCreate() I set this:this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); and because of it in never reads the layout folder no matter how I switch the view of my phone its always consider as a landscape view – adrian Aug 24 '11 at 06:22
  • Hmm thats odd. Have you tried setting the orientation for the activity in the manifest file rather than doing it onCreate. It isnt much different but I cant get whats causing your problem. – blessanm86 Aug 24 '11 at 06:29
  • In this activity I take usage of the camera.I tried rotating the camera with 90 degrees, I tried setting up its orientation....but nothing.But that line does its effect only that my text on the button looks like that.I also tried animation for that....but animation switch my button...not my text.I've been struglling with this for days...and nothing.Let me try that with the manifest file and I'll let you know:) – adrian Aug 24 '11 at 06:35
  • http://stackoverflow.com/questions/1410504/android-how-to-make-application-completely-ignore-screen-orientation-change I've done this so there is no way for my phone to detect change orientation! – adrian Aug 24 '11 at 06:38
  • Well I tried setting the orientation in the android manifest file...and it works but there is no screen orientation change detected! – adrian Aug 24 '11 at 06:43
  • I guess you will have to use a function onConfiguationChanged function – blessanm86 Aug 24 '11 at 07:00