我正在尝试在我的应用程序中实现一个侧面菜单,它在大多数情况下都可以正常工作,但我遇到的问题是,一旦我显示菜单并尝试向下滚动,整个列表就会变成白色(背景)并且文本消失。
http://i.imgur.com/6a6TgJJ.png
http://i.imgur.com/ykT7hCN.png
上面我附上了两张显示菜单行为的图片,当我将手指从左向右滑动时,侧边菜单会显示,但是如果我在菜单中向下滚动,它会变成一个空的白名单,这是我的代码:
public class ControlApp extends SlidingActivity{
ArrayList<String> datos ;
ArrayAdapter<String> adaptador;
Intent intent;
private String[] mMenuLista;
// private MyCustomAdapter mAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_notificaciones);
setBehindContentView(R.layout.activity_menu);
Parse.initialize(this, "BqCCNsbb14MPgeWz3rznxO4DamuXUbsgiTug8P8I", "9j7GSLWnV46fkPsNMwnMD2FormAiclKlGitfDq2b");
ParseAnalytics.trackAppOpened(getIntent());
getSlidingMenu().setBehindOffset(100);
// mAdapter = new MyCustomAdapter();
PushService.setDefaultPushCallback(this, Notificaciones.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
mMenuLista = getResources().getStringArray(R.array.lista_menu);
// for(int i=0; i<=9;i++){
// mAdapter.addItem(mMenuLista[i]);
// if(i == 9){
// mAdapter.addSeparatorItem(mMenuLista[i]);
// }
// }
ListView primario = (ListView) findViewById(R.id.left_drawer);
primario.setAdapter(new ArrayAdapter<String>(this,R.layout.drawer_list, mMenuLista));
primario.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> pariente, View view, int posicion, long id) {
selectItem(posicion);
}
});
}
public void selectItem(int posicion){
switch (posicion) {
case 0:
intent = new Intent(ControlApp.this, Notificaciones.class);
startActivity(intent);
break;
case 1:
intent = new Intent(ControlApp.this, Calificaiones.class);
startActivity(intent);
break;
case 2:
intent = new Intent(ControlApp.this, Mensajes.class);
startActivity(intent);
break;
case 3:
intent = new Intent(ControlApp.this, Citas.class);
startActivity(intent);
break;
case 4:
intent = new Intent(ControlApp.this, Permisos.class);
startActivity(intent);
break;
case 5:
intent = new Intent(ControlApp.this, Eventos.class);
startActivity(intent);
break;
case 6:
intent = new Intent(ControlApp.this, Horarios.class);
startActivity(intent);
break;
case 7:
intent = new Intent(ControlApp.this, Circulares.class);
startActivity(intent);
break;
case 8:
intent = new Intent(ControlApp.this, ProgramaDeEstudios.class);
startActivity(intent);
break;
case 9:
intent = new Intent(ControlApp.this, Ajustes.class);
startActivity(intent);
break;
case 10:
ParseUser.logOut();
ParseUser currentUser = ParseUser.getCurrentUser();
if (currentUser == null){
// sesion cerrada correctamente
Toast toast = Toast.makeText(getApplicationContext(), "Sesión cerrada correctamente", Toast.LENGTH_SHORT);
toast.show();
Intent regis = new Intent (ControlApp.this, MainActivity.class);
startActivity(regis);
finish();
}else{
Toast toast = Toast.makeText(getApplicationContext(), "No se logro cerrar sesion, intentelo de nuevo", Toast.LENGTH_SHORT);
toast.show();
}
break;
default:
break;
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
我希望有人可以帮助我找到我的错误,以便我可以纠正错误。谢谢你!!!