我的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