各位大侠们好,本人第一天学习Andriod。编了第一个程序,显示helloword!可模拟器不显示。求助:<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"
tools:context=".MainActivity" > <TextView
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" /></RelativeLayout>package com.example.lz;import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;public class MainActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView)findViewById(R.id.test);
tv.setText("helloword");
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
谢谢大家帮忙看看啊?
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" > <TextView
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" /></RelativeLayout>package com.example.lz;import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;public class MainActivity extends Activity { @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView)findViewById(R.id.test);
tv.setText("helloword");
} @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
谢谢大家帮忙看看啊?
解决方案 »
- 文件路径问题
- android如何在同一个TextView或者EditText中显示不同大小的字体
- android 2.3.3 2.3.4中mediaplayer缓冲时间过长是怎么回事?有什么方法能够解决呢?
- 与C#服务端网络通信的问题!
- android v8谁懂
- textview 如何用程序定位到指定位置
- 困惑已久的问题 android中如何调用系统已经开发好的功能~~
- webview访问js不成功
- 在TextView中显示Html标记的图像 为什么只显示小方框不能显示图像?
- Android studio
- android ListView滚动导致CheckBox 状态不停变化
- 求助!无法定位软件包 的错误
android:id="@+id/test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world" android:textColor="#000000"
android:textSize="100dp"
/>
加多两句 android:textColor="#000000"
android:textSize="100dp"