kri*_*ara 7 android android-5.0-lollipop
我的Android Project Build Target是5.1.1 API 22
这个应用程序似乎适用于除Lollipop之外的每个操作系统版本.棒棒糖重新调整一些活动的高度(否定可滚动的布局)以及扰乱微调器.
单击微调器上的特定位置将在应用程序中输入不同的位置.我不知道为什么,我不知道如何解决这个问题.在某些情况下,即使单击微调器上的按钮,它也会在微调器上注册最底部的可见按钮.对于一些微调器,它将不允许用户滚动.
我的一个故障微调器代码是这样的:
ArrayAdapter<String>adapterl4 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,hbmlevel){
public boolean isEnabled(int position){
displayData(position);
return true;
}
};
selecthbm = (Spinner)findViewById(R.id.selecthbmlvl);
adapterl4.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
selecthbm.setAdapter(adapterl4);
selecthbm.setOnItemSelectedListener(this);
Run Code Online (Sandbox Code Playgroud)
我也尝试过为函数使用全局变量,displayData但我仍然得到相同的结果.
该应用程序是一个非常基本的应用程序,您可以在此处下载并在Java Compiler Compliance级别1.7上运行
我的xml的开头看起来像这样:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="fill_parent"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:fillViewport="true"
android:background="#C2DFFF">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
Run Code Online (Sandbox Code Playgroud)
displayData:
public void displayData(int pos){
herolvlTV.setText(hbmherolvl[pos]);
hbmshardTV.setText(getResources().getString(R.string.shards)+" " +String.valueOf(hbmshards[pos]));
hbmexpTV.setText(getResources().getString(R.string.maxexp)+" " +String.valueOf(hbmmaxexp[pos]));
}
Run Code Online (Sandbox Code Playgroud)
问题是这样的:
ArrayAdapter<String>adapterl4 = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item,hbmlevel){
public boolean isEnabled(int position){
displayData(position);
return true;
}
};
Run Code Online (Sandbox Code Playgroud)
该isEnabled功能在 Lollipop 上根本不起作用。解决办法是将该功能全部selecthbm.setOnItemSelectedListener(this);改为selecthbm.setOnItemSelectedListener(new OnItemSelectedListener(){...});并删除。isEnabled
我不知道为什么该isEnabled功能不起作用。如果有人愿意提供解释,我可以悬赏。
| 归档时间: |
|
| 查看次数: |
919 次 |
| 最近记录: |