Моя проблема заключается в том, что когда я пытаюсь всегда ставить ImageView в том же макете, что и TextView, и когда SetText(); записывает текст в текстовое изображение, ImageView выходит за рамки макета. Да, я знаю, что я мог бы поставить изображение на задний план, но мое изображение устанавливается setImageResource, и я не могу изменить его или проект идет вниз ...Помещение ImageView рядом с TextView
Так вот мой XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="onhar.personalhealth.Main"
android:baselineAligned="false"
android:weightSum="1"
android:orientation="horizontal">
<TextView
android:layout_width="300dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginBottom="100dp"
android:id="@+id/tip"
android:text=""
android:layout_gravity="bottom" />
<ImageView
android:layout_width="260dp"
android:layout_height="260dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="20dp"
android:id="@+id/imageView2" />
</LinearLayout>
Спасибо за то, кто отвечает на это!
почему вы даете жёстко прописанные ширину textView.Change его wrap_content и попробовать. –