1
根據圖庫的位置,一個或另一個edittext將獲得焦點。雖然我可以做到這一點,但行爲的圖庫會崩潰:當圖庫運行位置並將焦點放在edittext上時,圖庫的速度會崩潰。看起來畫廊太慢,無法按時收到請求。行爲圖庫在調用requestFocus時崩潰
我還沒有找到關於它的任何重要信息。
galleryView.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(
@SuppressWarnings("rawtypes") AdapterView adapterView,
View view, int pos, long l) {
if (pos == 0) {
pie_foto_1.post(new Runnable() {
public void run() {
pie_foto_1.requestFocus();
}
});
}
if (pos == 1) {
pie_foto_2.post(new Runnable() {
public void run() {
pie_foto_2.requestFocus();
}
});
}
if (pos == 2) {
pie_foto_3.post(new Runnable() {
public void run() {
pie_foto_3.requestFocus();
}
});
pie_foto_1.setVisibility(View.INVISIBLE);
pie_foto_2.setVisibility(View.INVISIBLE);
pie_foto_3.setVisibility(View.VISIBLE);
}
}
public void onNothingSelected(
@SuppressWarnings("rawtypes") AdapterView adapterView
) {
}
});