HappyIdiom之三Study界面的设计

目标:实现HappyIdiom Study界面的设计

study_item.xml文件:布局List中的每一项

<?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="horizontal"
    android:paddingBottom="1dip"
    android:paddingLeft="10dip"
    android:paddingRight="10dip"
    android:paddingTop="1dip" >

    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/introduction"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textColor="#000000"
        android:textSize="25sp" />

</LinearLayout>

StudyActivity:分类列表页面

public class StudyActivity extends ListActivity {
	List<Map<String, Object>> data;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_study);
		getData();
		SimpleAdapter simpleAdapter = new SimpleAdapter(this, data,
				R.layout.study_item, new String[] { "image", "introduction"},
				new int[] { R.id.image, R.id.introduction });
		setListAdapter(simpleAdapter);
	}

	private void getData() {
		data = new ArrayList<Map<String, Object>>();
		int[] images = new int[] { R.drawable.study_animal,
				R.drawable.study_human, R.drawable.study_season,
				R.drawable.study_nature, R.drawable.study_number,
				R.drawable.study_fable, R.drawable.study_different,
				R.drawable.study_other };
		int[] choices = new int[] { R.string.animal, R.string.human,
				R.string.season, R.string.nature, R.string.number,
				R.string.fable, R.string.different, R.string.other };
		for (int i = 0; i < images.length; i++) {
			Map<String, Object> map = new HashMap<String, Object>();
			map.put("image", images[i]);
			map.put("introduction", getString(choices[i]));
			data.add(map);
		}
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_study, menu);
		return true;
	}

}


问题:当设计完成这个页面时,标题栏滚动字幕不滚动了,大家可以一起来分析一下原因所在?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值