Blog Details

img
Design

how can i make vertical scroll view android

Spoke Right / 20 Nov, 2023

To scroll the child elements of a pallet inside a ScrollView, the Android ScrollView is used whose functionality is provided by the android.widget.ScrollView class. The default scroll view in Android is a vertical scroll view. As the name itself suggests, it scrolls the elements vertically. Similarly, for horizontal ScrollView, the HorizontalScrollView is used in Android.

Example:

activity_main.xml:

In the activity_main.xml file, we will drag the ScrollView from the palette and will place some palette elements inside it.


 
 
 
 
 
 
 
 
 
 
 
 
 

Activity class:(File: MainActivity.java)

In the MainActivity.java file, no new code is added.

package com.example.radioapp;
 
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
 
public class MainActivity extends AppCompatActivity {
 
   @Override
   protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
   }
}

0 comments

Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20210902/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0