Issue
I want the Edittext to have a height equal to the full height of the NestedScrollView, but I don't know how to do it
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/et_title"
app:layout_constraintBottom_toBottomOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_contain_rv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/et_title"
android:orientation="vertical"
android:visibility="gone">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_checklist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:orientation="vertical"
android:visibility="visible"/>
<LinearLayout
android:id="@+id/ll_add_checklist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="?attr/selectableItemBackground"
android:paddingEnd="@dimen/_80sdp"
android:alpha="0.7">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_add"
android:layout_width="@dimen/_30sdp"
android:layout_height="@dimen/_30sdp"
android:padding="@dimen/_5sdp"
android:scaleType="fitCenter"
app:tint="@color/black"
android:src="@drawable/ic_add"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_add"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/_5sdp"
style="@style/AppTheme.TextView.Content_Note"
android:gravity="center_vertical"
android:text="@string/text_add_item"/>
</LinearLayout>
</LinearLayout>
<com.sophimp.are.RichEditText
android:id="@+id/et_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:layout_marginTop="@dimen/_5sdp"
android:hint="@string/text_notes_here"
android:inputType="textMultiLine|textNoSuggestions"
style="@style/AppTheme.TextView.Content_Note"
android:gravity="top"
android:lineSpacingExtra="4dp"
android:visibility="visible"/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
This is an image of the NestedScrollView's scope[enter image description here][1]
This is an image of the scope of Edittext[enter image description here][2] [1]: https://i.stack.imgur.com/Ca674.png [2]: https://i.stack.imgur.com/3TG3N.png
I want the Edittext to take up the remaining height of the NestedScrollView
Solution
I found the way, just in NestedScrollView set "android:fillViewport="true"" and in Edittext set " android:layout_height="match_parent""
Answered By - DucK
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.