16 Program to display a TextView using Vertical ScrollView in Android Studio.

AndroidManifest.xml:


<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.blogspot.codingatharva.manualprograms">



<application

    android:allowBackup="true"

    android:icon="@mipmap/ic_launcher"

    android:label="@string/app_name"

    android:roundIcon="@mipmap/ic_launcher_round"

    android:supportsRtl="true"

    android:theme="@style/AppTheme">

    <activity android:name=".MainActivity">

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />



            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>

    </activity>

</application>



</manifest>


MainActivity.java:


package com.blogspot.codingatharva.manualprograms;



import android.os.Bundle;



import androidx.appcompat.app.AppCompatActivity;





public class MainActivity extends AppCompatActivity {





    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);



    }



}



activity_main.xml:

<?xml version= "1.0" encoding= "utf-8" ?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp">

        <TextView
            android:id="@+id/textView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="Vertical ScrollView example In computer displays, filmmaking, television production, and other kinetic \n
            displays, scrolling is sliding text, images or video across a monitor or display, vertically or horizontally. Scrolling \n,
            as such, does not change the layout of the text or pictures but moves (pans or tilts) the user's view across what is \n
            apparently a larger image that is not wholly seen.[1] A common television and movie special effect is to scroll credits, \n
            while leaving the background stationary. Scrolling may take place completely without user intervention (as in film credits) \n
            or, on an interactive device, be triggered by touchscreen or a keypress and continue without further intervention until a \n
            further user action, or be entirely controlled by input devices. Scrolling may take place in discrete increments \n
            (perhaps one or a few lines of text at a time), or continuously (smooth scrolling). Frame rate is the speed at which an \n
            entire image is redisplayed. It is related to scrolling in that changes to text and image position can only happen as often \n
            as the image can be redisplayed. When frame rate is a limiting factor, one smooth scrolling technique is to blur images during \n
            movement that would otherwise appear to jump \b
            Scrolling texts, also referred to as scrolltexts or scrollers, played an important part in the birth of the computer demo culture.
            The software crackers often used their deep knowledge of computer platforms to transform the information that accompanied their releases
            into crack intros. The sole role of these intros was to scroll the text on the screen in an impressive way.
            Many scrollers were plain horizontal scrollers, but demo coders also paid a lot of attention to creating new and different types of scrolling.
             The characters could, for example, continuously alter their shape, take unusual flying paths or incorporate color effects such as raster bars.
            Sometimes it makes the text nearly unreadable.
" />


    </ScrollView>


</RelativeLayout>



Output:
Program to display a TextView using Vertical ScrollView in Android Studio

Previous
Next Post »