Blog Details

img
Design

How do i make horizontall scroll veiw android

Spoke Right / 20 Nov, 2023

The Horizontal ScrollView in Android is a FrameLayout which is used to scroll the child elements or views in a horizontal direction. The functionality of a horizontal scroll view in Android is facilitated by the android.widget.HorizontalScrollView class.As the name itself suggests, it only supports horizontal scrolling. Vertical ScrollView can be used in Android for vertical scrolling.

Example:

activity_main.xml:

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



 
 
   
 
 
   
       
 
           
 
          
 

Activity class:

In the MainActivity.java, no code is added other than the auto-generated code itself.

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