我的textview显示为空白!甚至当我把一个字符串,它显示blank..Please告诉我该怎么做Textview没有显示任何内容
protected void OnCreate (Bundle savedInstanceState) throws ClientProtocolException, IOException, JSONException{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView result = (TextView) findViewById(R.id.text1);
result.setText("TESTING");
这是我的XML
<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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
删除抛掷的onCreate异常,然后检查。 –
我试了..still什么也没有 – CanucksGirl
其工作正常,但如果它的问题与你的代码,那么请把你的完整代码在这里.. – Ajay