我的Android项目构建目标是5.1.1 API 22棒棒糖上的微调器故障
此应用程序似乎适用于除棒棒糖以外的每个操作系统版本。棒棒糖重新调整了一些活动的高度(否定了可滚动的布局),并扰乱了纺纱者。
单击微调框上的特定位置将在应用中输入不同的位置。我不知道为什么,我不知道如何解决这个问题。在某些情况下,即使您单击微调器上的按钮,它也会在微调器上注册最下方最显眼的按钮。对于某些纺纱厂来说,它不会允许用户滚动。
我的一个故障代码微调是这样的:
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和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" >
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]));
}
有什么方法'displayData'呢? – fRoStBiT
@fRoStBiT它只是为一些textviews设置文本 – krikara
你为什么要在'isEnabled()'中做它?你应该在'getView()'中做到这一点。 – fRoStBiT