के बीच चल रहा है मेरे पास 2 टुकड़े हैं जिनमें कुछ संपादन टेक्स्ट बॉक्स हैं। वे दोनों समान हैं, हालांकि यह बहुत अजीब है कि 1 संपादन टेक्स्ट फ़ील्ड के बीच टैब होगा, लेकिन दूसरा नहीं होगा।एंड्रॉइड एक्सएमएल - एडिटटेक्स्ट फ़ील्ड्स
यह एक मैं के साथ समस्या आ रही है है:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/loginparent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff008DFF" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dip"
android:background="#ff008DFF"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="40dip"
android:contentDescription="@string/logoDesc"
android:src="@drawable/logo1" />
<EditText
android:id="@+id/usernameLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/username"
android:imeOptions="actionNext"
android:singleLine="true"
android:textSize="14sp" />
<EditText
android:id="@+id/passwordLog"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:singleLine="true"
android:textSize="14sp" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/login" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dip" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="@string/newuser"
android:textColor="#ffffffff"
android:textSize="14sp" />
<Button
android:id="@+id/viewSignupBtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/signup" />
</LinearLayout>
</LinearLayout>
<ProgressBar
android:id="@+id/progressBarLog"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:padding="70dip"
android:visibility="gone" />
</RelativeLayout>
जब मैं पहली बार EditText बॉक्स के टैब, ध्यान एक 2 टैब यह 2 क्षेत्र के लिए ध्यान केंद्रित करने से चलता है पर गायब हो जाता है तो। यदि मैं टैब फोकस चला जाता हूं तो फिर वही होगा, फिर टैब फिर से करें और यह नीचे दिए गए बटन पर दिखाई देता है।
फ़्रेगमेंट के ऑनक्रेट व्यू में कुछ भी विशेष नहीं है, पॉइंटर्स को संपादन टेक्स्ट फ़ील्ड में प्राप्त करने के अलावा। जैसे मैं कहता हूं, मेरे पास दूसरा दृश्य बहुत समान है जो ठीक काम करता है।
जब मैं टैब, मैं नोटिस मैं इन चेतावनियों Logcat में प्रदर्शित मिलती है:
04-24 19:31:29.695: D/InputEventConsistencyVerifier(2040): KeyEvent: ACTION_UP but key was not down.
04-24 19:31:29.695: D/InputEventConsistencyVerifier(2040): in [email protected]
04-24 19:31:29.695: D/InputEventConsistencyVerifier(2040): 0: sent at 4325570000000, KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=4325570, downTime=4325514, deviceId=0, source=0x101 }
04-24 19:31:31.076: D/InputEventConsistencyVerifier(2040): KeyEvent: ACTION_UP but key was not down.
04-24 19:31:31.076: D/InputEventConsistencyVerifier(2040): in [email protected]
04-24 19:31:31.076: D/InputEventConsistencyVerifier(2040): 0: sent at 4326945000000, KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=4326945, downTime=4326889, deviceId=0, source=0x101 }
04-24 19:31:32.255: D/InputEventConsistencyVerifier(2040): KeyEvent: ACTION_UP but key was not down.
04-24 19:31:32.255: D/InputEventConsistencyVerifier(2040): in [email protected]
04-24 19:31:32.255: D/InputEventConsistencyVerifier(2040): 0: sent at 4328123000000, KeyEvent { action=ACTION_UP, keyCode=KEYCODE_TAB, scanCode=15, metaState=0, flags=0x8, repeatCount=0, eventTime=4328123, downTime=4328053, deviceId=0, source=0x101 }
संपादित -----------------
ठीक है, टिप्पणियों में सुझाव दिया गया है, मैंने फोकस चेंज श्रोताओं को सभी विचारों में जोड़ा (उन सभी के माध्यम से लूप किया गया और श्रोता जोड़ा) और लॉग इन किया कि क्या दृश्य है। प्रत्येक बार जब मैं टैब प्राप्त करता हूं, मुझे लॉग मिलता है लेकिन अजीब बात यह है कि, मैं पहले संपादन टेक्स्ट बॉक्स में टैब करता हूं और लॉग कहता है कि संपादन टेक्स्ट बॉक्स पर ध्यान केंद्रित किया गया है, मैं फिर से टैब करता हूं और फोकस खो जाता है लेकिन लॉग कहता है कि वही संपादन टेक्स्ट बॉक्स फोकस करता है! टैब फिर से और दूसरा फोकस हो जाता है और लॉग सही आईडी कहता है, टैब फिर से खो गया है लेकिन फिर लॉग कहता है कि दूसरा संपादन टेक्स्ट बॉक्स फोकस है, भले ही यह नहीं है !!
बहुत अजीब व्यवहार।
'android: focusableInTouchMode' समस्या हो सकती है? –
मुझे डर नहीं है। EditText वैसे भी ध्यान केंद्रित योग्य है। – Darren
क्या फ्रैगमेंट को जोड़ने के तरीके से कुछ करना पड़ सकता है? साथ ही, क्या यह संभवतः एक तरीका है कि यह पता लगाने का तरीका है कि जब यह ExitText बॉक्स से गायब हो जाता है तो फोकस क्या हो रहा है? – Darren