简体   繁体   中英

Horizontal Scrolling Fragment with Custom View

I have a small problem , or rather I do not know how. I combed through every corner of the Internet ( guides , tutorials etc ... )

In practice I have extended a class of VIEW and I customized the class with canvas etc ...

This view is included in a layout where there is also button, and this layout is set to a fragment and shown in an Activity (as usual ) .

I need to do the " scroll " horizontal in custom view to show all the graphics even hidden because the screen is small . You know tell me some solution or guide?

I hope I explained myself . Let me know and thanks in advance Greetings

Use HorizontalSCrollView with LinearLayout and add your elements.

 <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

<!-- your elements-->

      </LinearLayout>
</HorizontalScrollView>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM