I'd like to have a text field and a scrollable (that contains a drawable) in an application. I'd like the textview to stay anchored to the screen as I scroll. I already have the drawview being rendered in the scrollview with this code in my activity file:
drawView = new DrawView(this, height, width, SMD);
drawView.setBackgroundColor(Color.WHITE);
ScrollView scrollView = new ScrollView(this);
scrollView.addView(drawView);
setContentView(scrollView);
I saw this page:
Android: How do I add a footer to a fullscreen scrollview?
To prevent you from having to follow the link they suggest a Manifest entry such as:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow><TextView android:text="Text1"/></TableRow>
<TableRow><TextView android:text="Text2"/></TableRow>
</TableLayout>
<RelativeLayout
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:text="@string/lorem_ipsum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:text="Text3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:text="Text4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
Reading that page I thought I could employ the Manifest changes listed in the above hyperlink along with this modified code:
drawView = new DrawView(this, height, width, SMD);
drawView.setBackgroundColor(Color.WHITE);
ScrollView scrollView = new ScrollView(this);
scrollView.addView(drawView);
setContentView(scrollView);
TextView tv = new TextView(this);
tv.setText("Hellow World Im running with no issue");
setContentView(tv);
to obtain what I want. However the screen only renders the scrollview or the TextView (depending on which one is called last). Do I realy need to make the Manifest changes as noted in the other answer? I do not list any objects such as ScrollViews in my current manifest, but I cannot imagine that causes a problem. Listing them now should simply define HOW they behave with the other objects, correct?