I have a simple construction; a TextView in a Scrollview, but I cannot make it work as I want.
The problems I get now;
I got the following:
<HorizontalScrollView
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_gravity="right"
android:background="@drawable/background_scrollviews_display"
android:id="@+id/scrollViewSum">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right">
<TextView
style="@style/TextStyleDisplay"
android:textSize="@dimen/fontSizeTextViewSum"
android:paddingLeft="@dimen/paddingDisplayTextViews"
android:paddingRight="@dimen/paddingDisplayTextViews"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"
android:gravity="right|center"
android:id="@+id/textViewSum"/>
</LinearLayout>
</HorizontalScrollView>
What I want;
I tried a lot, but I simply cannot find the right solution.
I hope someone can help me out!
I have a two clue to solve your problems:
1) make LinearLayout orientation Vertical, then you can position TextView on the right
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right">
<TextView
style="@style/TextStyleDisplay"
android:textSize="@dimen/fontSizeTextViewSum"
android:paddingLeft="@dimen/paddingDisplayTextViews"
android:paddingRight="@dimen/paddingDisplayTextViews"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"
android:gravity="right|center"
android:id="@+id/textViewSum"/>
</LinearLayout>
2) make TextView wrap_content instead of match_parent
<TextView
style="@style/TextStyleDisplay"
android:textSize="@dimen/fontSizeTextViewSum"
android:paddingLeft="@dimen/paddingDisplayTextViews"
android:paddingRight="@dimen/paddingDisplayTextViews"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:gravity="right|center"
android:id="@+id/textViewSum"/>