文章列表
XML文件
main.xml文件
两个控件按钮btnListView和btnSlidingDrawer
<Button
android:id="@+id/listView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/listviewStr" ...
XML中一个ViewFlipper
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation=" ...
java代码
tv01 = (TextView)findViewById(R.id.tv01);
tv01.setTextColor(Color.RED);
tv01.serTextSize(22f);
//html字符:超链接
String htmlhref = "<a href=\"http:www.google.com.hk\">百度</a>";
//Html.fromHtml解析HTML,生成String
tv01.setText(Html.fromHtml(htmlhref));
//html字符:只显示超链接,不使 ...
xml页面
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" ...
[b]绘制3*3游戏界面,并实现在其上添加字
创建ProjActivity类继承Activity类
public class ProjActivity extends Activity{
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MyGridView2 mgv = new MyGridView2(this);
...