skip to Main Content

I’v tried to make a design for “following” with the numbers so I create a line by photoshop and I faced some problems :
enter image description here

so the problem was in the word following and the the number . I want to make them closer to the line but I can’t because the line is an image view, so how can that be done ?

2

Answers


  1. An option would be considering negative margin top for your line (ImageView).

    <ImageView
        android:layout_marginTop="-10dp"
        ... />
    

    Please see this post for more info

    Login or Signup to reply.
  2. Use frame layout, and place where ever you wanted, negative margin wont give better result on different-different devices.

    <FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TextView
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:textColor="#000"
           android:textSize="40dp"
           android:gravity="right"
           android:text="@string/top_text" />
    
        <ImageView
           android:id="@+id/ImageView01"
           android:layout_height="fill_parent"
           android:layout_width="fill_parent"
           android:src="@drawable/lake"
           android:scaleType="matrix"></ImageView>
        <TextView
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:text="@string/bottom_text"
           android:gravity="right"
           android:textColor="#fff"
           android:textSize="50dp" />
    </FrameLayout>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search