결과화면

 

 TextViewDemo.java

 

package com.example.demo;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class TextViewDemo extends Activity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.tv_demo);
 }
}

 

--------------------------------------------------------------------------------------------------

 

tv_demo.xml

 

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/autolink_test" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dash" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:autoLink="all"
            android:linksClickable="false"
            android:text="@string/autolink_test" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dash" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:autoLink="all"
            android:linksClickable="true"
            android:text="@string/autolink_test" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dash" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/ell_test" />
       
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/dash" />
       
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/ell_test"
            android:singleLine="true" />

    </LinearLayout>

</ScrollView>

 

--------------------------------------------------------------------------------------------------

 

string.xml

 

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

    <string name="app_name">Day2</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>
    <string name="autolink_test">This is a test. My blog is at
        http://androidbook.blogspot.com\nEmail me at
        test@gmail.com\nCall me at (800) 555-1212\nFind me at my favorite coffee joint
        1456 White Mountain Hwy, North Conway, NH 03860</string>
    <string name="ell_test">Word supercallafragalisticexpealadocious.</string>
    <string name="dash">---------------------------------------------------------------</string>

</resources>

 

+ Recent posts