【发布时间】:2022-08-18 18:12:13
【问题描述】:
我很困惑为什么当我的光标聚焦在EditText 内时它不向下滚动,为了滚动你只需要点击另一个向下滚动,有什么办法可以处理这个?
我已经在Layout 中使用过这个命令,但它不起作用,需要帮助
android:focusable=\"true\"
android:focusableInTouchMode=\"true\"
这是我的活动
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
xmlns:app=\"http://schemas.android.com/apk/res-auto\"
android:background=\"@color/primary\"
android:focusable=\"true\"
android:focusableInTouchMode=\"true\"
android:orientation=\"vertical\">
<TextView
android:id=\"@+id/textView1\"
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:textColor=\"@color/white\"
android:layout_margin=\"15dp\"
android:textStyle=\"bold\"
android:text=\"I. Demographics\"
android:fontFamily=\"sans-serif-condensed\"
android:textAppearance=\"?android:attr/textAppearanceLarge\"
android:textSize=\"15dp\" />
<ScrollView
android:background=\"@color/white\"
android:layout_width=\"wrap_content\"
android:layout_height=\"match_parent\">
<RelativeLayout
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:orientation=\"horizontal\">
<LinearLayout
android:layout_width=\"match_parent\"
android:layout_height=\"match_parent\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"10dp\"
android:layout_marginRight=\"10dp\"
android:focusable=\"true\"
android:focusableInTouchMode=\"true\"
android:orientation=\"vertical\">
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_hhid\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"30dp\"
android:layout_marginRight=\"10dp\"
app:errorEnabled=\"true\"
app:counterEnabled=\"true\"
app:counterMaxLength=\"30\"
app:endIconMode=\"clear_text\"
app:helperText=\"Search Household ID!\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_hh\">
<EditText
android:id=\"@+id/edtHhId\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Household no.\"
android:inputType=\"text\"
android:maxLength=\"30\" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width=\"wrap_content\"
android:layout_height=\"wrap_content\"
android:layout_gravity=\"right\">
<Button
android:id=\"@+id/btnSearchHh\"
android:layout_width=\"100dp\"
android:layout_height=\"wrap_content\"
android:layout_gravity=\"right\"
android:layout_marginRight=\"10dp\"
android:padding=\"10dp\"
android:textSize=\"12dp\"
android:text=\"Search\"
android:textStyle=\"bold\"
/>
</LinearLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_fullname\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_search\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"15dp\"
android:layout_marginRight=\"10dp\"
app:endIconMode=\"clear_text\"
app:helperText=\"Required\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_person\">
<EditText
android:id=\"@+id/edtFullname\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Full name:\"
android:inputType=\"text\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_clientstatus\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_fullname\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
app:helperText=\"Required\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_client\">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id=\"@+id/spinnerClientStatus\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Client status\"
android:inputType=\"none\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_address\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_clientstatus\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
app:endIconMode=\"clear_text\"
app:helperText=\"Required\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_baseline_location_on_24\">
<EditText
android:id=\"@+id/edtAddress\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Address\"
android:inputType=\"text\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:id=\"@+id/til_sex\"
app:helperText=\"Required\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
android:layout_marginLeft=\"10dp\"
app:helperTextTextColor=\"@color/validation\"
android:layout_below=\"@+id/til_address\"
app:startIconDrawable=\"@drawable/ic_baseline_supervised_user_circle_24\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu\">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id=\"@+id/spinnerSex\"
android:editable=\"false\"
android:layout_width= \"match_parent\"
android:hint=\"Sex\"
android:layout_height=\"wrap_content\"
/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_contact_no\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_sex\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
app:endIconMode=\"clear_text\"
app:helperText=\"Required\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_baseline_phone_android_24\">
<EditText
android:id=\"@+id/edtContactNo\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Contact No.\"
android:inputType=\"number\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_set\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_contact_no\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
app:endIconMode=\"clear_text\"
app:helperText=\"Required\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_assigned\">
<EditText
android:id=\"@+id/edtSet\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Set\"
android:inputType=\"number\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id=\"@+id/til_assigned\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:layout_below=\"@+id/til_contact_no\"
android:layout_marginLeft=\"10dp\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
app:endIconMode=\"clear_text\"
app:helperTextTextColor=\"@color/validation\"
app:startIconDrawable=\"@drawable/ic_baseline_person_24\">
<EditText
android:id=\"@+id/edtAssigned\"
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:hint=\"Assigned C/ML\"
android:inputType=\"text\" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width=\"match_parent\"
android:layout_height=\"wrap_content\"
android:id=\"@+id/til_minor_grantee\"
android:layout_marginTop=\"20dp\"
android:layout_marginRight=\"10dp\"
android:layout_marginLeft=\"10dp\"
android:layout_marginBottom=\"80dp\"
app:helperTextTextColor=\"@color/validation\"
android:layout_below=\"@+id/til_assigned\"
app:startIconDrawable=\"@drawable/ic_baseline_escalator_warning_24\"
style=\"@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense.ExposedDropdownMenu\">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id=\"@+id/spinnerMinorGrantee\"
android:layout_width= \"match_parent\"
android:hint=\"Minor Grantee\"
android:layout_height=\"wrap_content\"
/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</RelativeLayout>
</ScrollView>
</LinearLayout>
-
谁能知道如何处理这个错误?我在这个区域使用
viewPager,就像登机屏幕一样