Put blackline border around ScrollView - Android
android, border, java, scrollview
Solution
In light of your new requirements, try the following code:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid
android:color="@android:color/transparent"/>
<stroke
android:width="2dp"
android:color="#000000"/>
</shape>
Problem
My question is if there is a way to put a simple blackline border around a `ScrollView` so the user is aware exactly where the `ScrollView` starts, stops and how wide it is. I cannot find any sort of XML or java code in the Android docs saying how to do this. I know this has to be possible. Below is my XML code for the `ScrollView` I need to have a border. ``` <LinearLayout .... /> <TextView ... /> //BORDER STARTS HERE <ScrollView android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="94.5" android:paddingBottom="5dp" android:fillViewport="true" > <LinearLayout ... > <TextView ... /> </LinearLayout> </ScrollView> //BORDER ENDS HERE <Button ... /> </LinearLayout> ``` EDIT I just added a `scrollviewborder.xml` with the following code as a background for the `ScrollView`. ``` <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke android:width="2dp" android:color="#000000"/> </shape> ``` The below screenshot is what it produced: This is not quite what I wanted. I want a thin blackline bordering around and not a black box.