我的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