在AppBarLayout的底部,我使用了CollapsingToolbarLayout,我有一个 EditText和一个ImageView (作为按钮)。
当AppBarLayout 打开时,我的editText和ImageView 正常工作。
但是,当我崩溃并且他们获得工具栏的空间时,他们似乎不再可点击。
这里工作正常。 但当他们得到这个蓝色边框空间(工具栏) 停止工作。我无法点击" LOS"或者输入更多内容
我的XML代码
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="210dp"
android:stateListAnimator="@animator/appbar_always_elevated"
android:background="@color/neah_screen_bg_white">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:collapsedTitleTextAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
app:expandedTitleMarginStart="72dp"
app:expandedTitleTextAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/main_home_banner_img"
android:layout_width="0dp"
android:layout_height="0dp"
android:contentDescription="@string/background_to_text_contentDescription"
android:scaleType="centerCrop"
android:src="@drawable/bg_home"
app:layout_collapseMode="parallax"
app:layout_constraintBottom_toTopOf="@+id/main_home_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="@+id/main_home_banner_filter"
android:layout_width="0dp"
android:layout_height="0dp"
android:alpha="0.4"
android:contentDescription="@string/shadow_contentDesxription"
app:layout_constraintBottom_toTopOf="@+id/main_home_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/gradient_bg" />
<ImageView
android:id="@+id/main_home_neah_logo"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:contentDescription="@string/icon_contentDescription"
app:layout_constraintEnd_toEndOf="@+id/main_home_banner_filter"
app:layout_constraintStart_toStartOf="@+id/main_home_banner_filter"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@mipmap/icon_neah_logo_white" />
<TextView
android:id="@+id/main_home_cta_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/str_home_cta_text"
android:textColor="@color/neah_text_white"
android:textSize="@dimen/size_text_app_bar"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/main_home_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/main_home_neah_logo" />
<EditText
android:id="@+id/main_home_text"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="16dp"
android:background="@color/transparent"
android:ems="10"
android:hint="@string/str_home_service_cta"
android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/main_home_button_text"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/main_home_button"
android:layout_width="90dp"
android:layout_height="0dp"
android:contentDescription="@string/button_contentDescription"
app:layout_constraintBottom_toBottomOf="@+id/main_home_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/main_home_text"
app:srcCompat="@color/neah_btn_orange" />
<TextView
android:id="@+id/main_home_button_text"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/str_go"
android:textColor="@color/neah_text_white"
android:textSize="@dimen/size_text_big"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/main_home_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/main_home_text"
app:layout_constraintTop_toTopOf="@+id/main_home_text" />
</android.support.constraint.ConstraintLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="40dp"
app:layout_collapseMode="pin" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/main_home_list_swipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
<android.support.v7.widget.RecyclerView
android:id="@+id/main_home_list"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.design.widget.CoordinatorLayout >
答案 0 :(得分:1)
我不是Android开发人员,但从目前为止我完成的其他UI工作来看,您的容器的一部分似乎位于您想要点击的UI元素的前面。