0

I have an image view and a textView.

When i test it in bigger devices, the image changes his position.

layout xml:

<TextView
    android:id="@+id/monedas_pow"
    android:text="300"
    android:textSize="29sp"
    android:layout_marginLeft="10dp"
    android:textColor="@color/titlecolor"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    />
<ImageView
    android:id="@+id/summary_btn"
    android:src="@drawable/coin"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="525dp"
    android:layout_toRightOf="@id/monedas_pow"
    android:layout_marginTop="8dp"
    android:layout_marginLeft="5dp"
    android:layout_marginRight="280dp" />

It have to look like this

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Martin De Simone
  • 2,108
  • 3
  • 16
  • 30
  • Possible duplicate of [How do I use a compound drawable instead of a LinearLayout that contains an ImageView and a TextView](http://stackoverflow.com/questions/8318765/how-do-i-use-a-compound-drawable-instead-of-a-linearlayout-that-contains-an-imag) – OneCricketeer Nov 15 '16 at 00:45
  • You have to create different folders for different devices containing the devices style, dimensions, etc.. – HaroldSer Nov 15 '16 at 01:15
  • marginBottom is the problem you have. – Yuichi Akiyoshi Nov 15 '16 at 02:18

2 Answers2

0

Its because you have huge margins on bottom and right. Just remove bottom and right margin and add android:layout_alignBaseline="@+id/monedas_pow" And you are missing + in toRightOf so add it android:layout_toRightOf="@+id/monedas_pow"

Jozef Dochan
  • 926
  • 10
  • 27
0

Use RelativeLayout, in that specify align_centerInParent = true for text_view and use layout_below = "your text view id" to your image_view. Example:

Try this..hope it will work

Kiran Nemani
  • 67
  • 1
  • 6