我的 Android 项目构建目标是 5.1.1 API 22
这个应用程序似乎适用于除 Lollipop 之外的所有操作系统版本。 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);
我还尝试过为该函数使用全局变量displayData
但我仍然得到相同的结果。
该应用程序是一个非常基本的应用程序,您可以下载here https://play.google.com/store/apps/details?id=ccpackage.castleclashcalculator并在 Java 编译器合规性级别 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" >
显示数据:
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]));
}