See the layout xml:

    <LinearLayout xmlns:tools="http://schemas.android.com/tools";
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity" xmlns:android="
http://schemas.android.com/apk/res/android";>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginBottom="10dp"
        android:layout_marginTop="10dp"
        android:text="Temperature Chart"
        android:textAppearance="?android:attr/textAppearanceLarge" />

    <LinearLayout
        android:id="@+id/chartContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/textTemperature"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:transformPivotX="0sp"
            android:translationY="0sp"
            android:rotation="-90"
            android:text="Temperature" />

    </LinearLayout>
</LinearLayout>
 
then I insert a chart view into the "chartContainer" LinearLayout. The 
executing result is as the following picture:
you can see the problem is, after "textTemperature" is rotated, it still 
occupy the room as before it rotated, bellow layout view confirmed this.

<https://lh4.googleusercontent.com/-qw0ryGAA_6A/UXo1t4C2RjI/AAAAAAAAAA8/Buvso--p66I/s1600/chart1.png>


My question is how can I make the "textTemperature" widget only occupy the 
width as it is looked like? that's, there is no additional blank between 
"textTemperature" and the chart.
I know writing a customized widget or putting the rotated widget in an 
individual FrameLayout could accomplish this, I mean to seek there is any 
lighter way, such as a property, etc.

 

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to