android textview
本人菜鸟代码如下:publicclassActivity01extendsActivity{/**Calledwhentheactivityisfirstcreated....
本人菜鸟代码如下:
public class Activity01 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
1. TextView myTextView=(TextView)findViewById(R.id.myTextView);
2. Button myButton = (Button)findViewById(R.id.myButton);
myTextView.setText("my first Textview");
myButton.setText("my first button");
}
}
1. 2.两行错误,
TextView cannot be resolved to a type
Button cannot be resolved to a type
我是照着视频做的 ,不过他再写那个的时候好像说了什么访问一下
求解释 展开
public class Activity01 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
1. TextView myTextView=(TextView)findViewById(R.id.myTextView);
2. Button myButton = (Button)findViewById(R.id.myButton);
myTextView.setText("my first Textview");
myButton.setText("my first button");
}
}
1. 2.两行错误,
TextView cannot be resolved to a type
Button cannot be resolved to a type
我是照着视频做的 ,不过他再写那个的时候好像说了什么访问一下
求解释 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询