0

我有这个:

row_selector.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"       android:exitFadeDuration="@android:integer/config_mediumAnimTime">

<item android:drawable="@color/green" android:state_pressed="true"/>
<item android:drawable="@color/blue" android:state_selected="true"/>
<item android:drawable="@color/yellow" android:state_activated="true"/>

</selector>

专辑项目.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/row_selector"
android:orientation="horizontal"
android:padding="5dip" >

AlbumCursorAdapter.java

public class AlbumCursorAdapter extends CursorAdapter {
...
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
    final View view = mInflater.inflate(R.layout.album_item, parent, false);
...
}

为什么在 android 4.0 中工作而不在 Froyo 中工作?

谢谢!!

4

1 回答 1

0

android:state_activated 是在 android 3.0 (API 11) JavaDoc中引入的

于 2013-07-26T11:49:31.710 回答