Thursday, December 5, 2013

How to get content TEXT VIEW text box?

As the title, what method to get the input text box empty TEXT VIEW, please list the specific code, thank you! !
Reply:
gettext () method ah
Reply:
uitextview find this approach you?
Reply:
textview.text
Reply:
text is an attribute; getText is the default method to get this property. That is to follow the so-called getter / setter specification. Similarly, you can use for this property assignment method setText
Reply:
According naming cocoa, the name should be the name accessor methods instead of getName
Reply:
references, 4th Floor reply:
text is an attribute; getText get this property is the default method. That is to follow the so-called getter / setter specification. Similarly, you can use for this property assignment method setText


Is not text.getText (), but the error
Reply:
Give you an example! ! ! Oh
Research


android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: orientation = "vertical">

android: id = "@ + id / ttttt"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: text = "@ string / hello" />









package com.ti;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class TtttActivity extends Activity {
/ ** Called when the activity is first created. * /
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
TextView t = (TextView) findViewById (R.id.ttttt);
t.setText ("I am a textview");
System.out.print (t.getText ());

setContentView (R.layout.main);
}
}


so easy

No comments:

Post a Comment