How can I add a custom view to the HorizontalScrollView?
2 answers
this can be done in the XML of the project, what you want to do, whatever you want to include in the scrollview, you put inside the scrollview in the xml. it will be in between:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
and:
</ScrollView>
0
a source to share
Imagine your custom component is named (class) MyCustomComponent and its package is org.neteinstein.code
xml:
<HorizontalScrollView android:id="@+id/scroll" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:fillViewport="true">
<org.neteinstein.code.MyCustomComponent android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</HorizontalScrollView >
0
a source to share