AZER
AZER

Reputation: 23

LinearLayout multi screen

I made a LinearLayout with horizantal orientation. In this leanerLayout I put 3 ImageView. All it works when I test with my emulator but if I test my APK in another small screen smartphone an image does not appear correctly despite all the images are in multi screen like below

enter image description here

<LinearLayout
    android:id="@+id/linearLayout"
    android:layout_width="match_parent"
    android:layout_height="56dp"
    android:layout_marginBottom="24dp"
    android:background="@color/colorBleu"
    android:orientation="horizontal"
    app:layout_constraintBottom_toTopOf="@+id/tableLayout">

    <ImageView
        android:id="@id/img1"
        android:layout_width="wrap_content"
        android:layout_height="55dp"
        android:src="@drawable/tooll"
        />

    <ImageView
        android:id="@+id/img2"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:src="@drawable/logofi15"
        android:layout_width="wrap_content" />

    <FrameLayout
        android:id="@+id/frameLayout"
        android:layout_width="53dp"
        android:layout_height="53dp"
        android:layout_marginLeft="5dp">

        <ImageView
            android:id="@+id/imageView2"
            android:src="@drawable/squarem"
            android:layout_marginTop="2dp"
            android:layout_height="match_parent"
            android:layout_width="match_parent" />

        <TextView
            android:id="@+id/tv"
            android:gravity="center"
            android:text=""
            android:textColor="#FFFFFF"
            android:textSize="16sp"
            android:textStyle="bold"
            android:layout_height="52dp"
            android:layout_width="52dp" />
    </FrameLayout>
</LinearLayout>

I need help

Upvotes: 1

Views: 64

Answers (1)

Fan Applelin
Fan Applelin

Reputation: 781

Try to use

android:layout_width="0dp"
android:layout_weight="1"

instead of

android:layout_width="wrap_content"

Or add

android:layout_maxWidth="your dps"

Upvotes: 1

Related Questions