Fernando Carvalho
Fernando Carvalho

Reputation: 403

Slide Down Android (no animation)

Hi I need some help in understand this property/functionality from Android...

Maybe I can looking around for something wrong... but I'm almost sure that I need use the slide down "property" to see the rest of my textview... rigth?

But how? I am not understanding the flow...

Area to affect.

public class PrintBtInvoice extends Activity
{
    String constActivityName = "PrintBtInvoice";
    // ------------------------------------------------------------------------

    ScrollView  sView = null;
    TextView txtIDorder = null;
    TextView txt2Print = null;
    TextView txt2View = null;

    Button btnBack = null;
    Button btnPrint = null;

    public void onCreate(Bundle savedInstanceState)
    { 

         sView = (ScrollView) findViewById(R.id.scrollView );
         txtIDorder = (TextView) findViewById(R.id.txtPBIorderId);
         txt2Print = (TextView) findViewById(R.id.txtPBIinvoice2print);
         txt2View = (TextView) findViewById(R.id.txtPBIinvoice2view);

         btnBack = (Button) findViewById(R.id.btnPBIback);
         btnPrint = (Button) findViewById(R.id.btnPBIprint);
         ...
    }

    btnPrint.setOnClickListener(new OnClickListener()
    { ... }
}

What I need to do to see the rest of my text2Print??

Changes suggested :)

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/scrollView"
    android:layout_gravity="center_horizontal" >
    <TextView
         android:id="@+id/txtPBIinvoice2print"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/btnPBIback"
        android:layout_toLeftOf="@+id/btnPBIprint"
        android:text="@string/app_blank" />
</ScrollView>

Upvotes: 0

Views: 459

Answers (1)

Vladyslav Matviienko
Vladyslav Matviienko

Reputation: 10881

I think you need to put your TextView into ScrollView. This way you would be able to scroll your text down and see it. Here is the sample XML layout:

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

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

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/scrollView"
        android:layout_gravity="center_horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Text"
            android:id="@+id/textView" />
    </ScrollView>
</LinearLayout>

Upvotes: 1

Related Questions