Android ListView不响应在滑动菜单中按
我开发了一个简单的应用程序,遇到了这样的问题。 ListView不响应滑动菜单中的单击Android ListView不响应在滑动菜单中按,android,listview,android-listview,Android,Listview,Android Listview,我开发了一个简单的应用程序,遇到了这样的问题。 ListView不响应滑动菜单中的单击 private SlidingMenu menu; --- menu = new SlidingMenu(this); menu.setMode(SlidingMenu.LEFT); menu.setTouchModeBehind(SlidingMenu.TOUCHMODE_FULLSCREEN); menu.setShadowDrawable(R.drawable.shadows_menu_swype1);
private SlidingMenu menu;
---
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeBehind(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowDrawable(R.drawable.shadows_menu_swype1);
menu.setShadowWidth(15);
menu.setFadeDegree(0.50f);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setBehindWidth(300);
menu.setMenu(R.layout.menu_swype);
创建时的滑动菜单
private SlidingMenu menu;
---
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeBehind(SlidingMenu.TOUCHMODE_FULLSCREEN);
menu.setShadowDrawable(R.drawable.shadows_menu_swype1);
menu.setShadowWidth(15);
menu.setFadeDegree(0.50f);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setBehindWidth(300);
menu.setMenu(R.layout.menu_swype);
如何创建ListView
SwypeMenuLV = (ListView) findViewById(R.id.menu_swypeID);
String[] menu_swypeStr = getResources().getStringArray(R.array.menu_swypeSTR);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item_menu_swype, menu_swypeStr);
SwypeMenuLV.setAdapter(adapter);
SwypeMenuLV=(ListView)findViewById(R.id.menu\u swypeID);
String[]menu\u swypeStr=getResources().getStringArray(R.array.menu\u swypeStr);
ArrayAdapter=新的ArrayAdapter(这个,R.layout.list\u item\u menu\u swype,menu\u swypeStr);
SwypeMenuLV.setAdapter(适配器);
ListView事件处理程序
SwypeMenuLV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
toast.setText("TEST!");
toast.show();
}
});
SwypeMenuLV.setOnItemClickListener(新的AdapterView.OnItemClickListener(){
@凌驾
public void onItemClick(AdapterView父对象、视图、int位置、长id){
toast.setText(“TEST!”);
toast.show();
}
});
XML列表视图
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shadows_menu_swype2"
android:orientation="vertical" >
<ListView
android:id="@+id/menu_swypeID"
android:layout_marginLeft="7dp"
android:layout_marginRight="7dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:divider="@drawable/boder_menu_swype"
android:dividerHeight="2dp">
</ListView>
列表项目菜单类型xml
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textColor="#f4f5f5"
android:textSize="18sp"
>
</TextView>
怎么了?
求求你,救命 请显示列表\项目\菜单\类型编码确实在帖子中增加了一点