0

I wrote this. I want that objects cover screen. I do not want there is empty space in the right of the screen. And I want that ImageView has special size.

<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:columnCount="1">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="EnglishWord"
            android:id="@+id/textView9"
            android:layout_gravity="center"
            android:gravity="center"
            android:textSize="18sp" />
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/volumeon"
            android:clickable="true"
            android:focusable="true"
            android:id="@+id/imageButton9"
            android:layout_gravity="center"
            android:gravity="center" />
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="EnglishWord"
            android:id="@+id/textView10"
            android:layout_gravity="center"
            android:gravity="center"
            android:textSize="20sp" />
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
        <ImageView
            android:id="@+id/imageView1"
            android:layout_gravity="center"
            android:gravity="center"
            android:background="@drawable/noimage"
            android:adjustViewBounds="true"
            android:layout_width="100dp"
            android:layout_height="100dp" />
        <Space
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1" />
    </LinearLayout>
</GridLayout>

I have two problem:

1-I want a space in top of the ImageView.

2-I determined "android:layout_height="100dp"" and "android:layout_width="100dp"" but I do not see these height and width in output.

user2111639
  • 287
  • 2
  • 5
  • 15
  • post screenshot of your screen as you want. – Deepak Sachdeva Dec 01 '16 at 11:05
  • describe question and add screenshot.. – Muhammad Waleed Dec 01 '16 at 11:37
  • I delete android:adjustViewBounds="true" and I see that the second problem was solved – user2111639 Dec 01 '16 at 13:33
  • After removing the android:adjustViewBounds="true" I tested this application several times but the second problem were not linked to removing the android:adjustViewBounds="true" . It is strange to me. – user2111639 Dec 01 '16 at 14:18
  • For solving the first problem, I used android:layout_margin="30dp" [link] (http://stackoverflow.com/questions/12864359/android-when-to-use-layout-margin-when-to-use-weightsum) and [link] (http://stackoverflow.com/questions/4259467/in-android-how-to-make-space-between-linearlayout-children) – user2111639 Dec 01 '16 at 14:40

0 Answers0