Итак, у меня есть что-то вроде этого:
LinearLayout:
LinearLayout - wrap_content, background black:
TextView - wrap_content
LinearLayout:
Image - 20dp
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:gravity="center|start"
android:padding="5dp"
android:layout_margin="2dp">
<TextView
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="klgjdkljgilfdjgidfhjiogjdio;jhgiju;fgjdhjgu;hdfuighdfuk;ghduk;fhgukldhfgujkdfhyufhglfdhguldfhguklhfdulghldfughyulfhdulghdfulghul"
android:textColor="#D5D5D5" />
<LinearLayout
android:layout_width="15dp"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginBottom="2dp"
android:layout_height="match_parent">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_gravity="bottom|center"
android:src="@drawable/edit" />
</LinearLayout>
</LinearLayout>
Это отлично работает, но когда TextView содержит текст, размер которого превышает размер экрана, изображение выходит за пределы экрана. Я не хочу, чтобы это произошло.
Вот пример:
Кто-нибудь знает, как это исправить, чтобы не go снаружи экран?
![enter image description here](https://i.stack.imgur.com/uBVFO.jpg)
Спасибо!