josephoneill
josephoneill

Reputation: 853

How to add scroll-like function in Android Application

I need to know how to, in a way, "extend" the screen. I'll explain. Basically, in my android application, the main setup is supposed to look like an app drawer. My app is portrait only, and will be 4x7(for each icon/button). When you click on a button, say, "Themes". It'll open a new class and display the themes. But there are to many themes to fit on the screen. I need to have it so they can simply scroll down and see more themes, and then let them scroll back up if they'd like. How would I add that scroll option, and then how would I add those buttons that require a scroll to see (What I mean is in an xml I can organize buttons, but if I added more, they'd be off the screen. Those ones off the screen would be the ones you'd have to scroll down to see. Is there a special way to add those buttons?) Sorry if I sound like an idiot. I'm only 15 and stilp learning. Thanks!

Upvotes: 0

Views: 889

Answers (1)

skomi
skomi

Reputation: 145

Use ScrollView, just add your layout in ScrollView.

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

    <!-- your layout -->

</ScrollView>

Upvotes: 1

Related Questions