ImageViewsをparentlayoutにストレッチしたい。私はmarginleftコマンドでやった。しかし、それは別の画面では役に立ちません。1つのレイアウトでいくつかのビューを伸ばす
私はマージンをjavaで変更したくありません。私はそれらのImageviewsすべての画面のためにストレッチしたいと思います。彼らはこれのための任意のコマンドですか?
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.berkay.uumobil.MainActivity">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_constraintBottom_creator="1"
tools:layout_constraintLeft_creator="1"
tools:layout_constraintRight_creator="1"
tools:layout_constraintTop_creator="1">
<LinearLayout
android:id="@+id/menuLayout"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<ImageView
android:id="@+id/menu_home"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
app:srcCompat="@drawable/home_button" />
<ImageView
android:id="@+id/menu_marks"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
app:srcCompat="@drawable/not_karti_button" />
<ImageView
android:id="@+id/menu_calender"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
app:srcCompat="@drawable/takvim_button" />
<ImageView
android:id="@+id/menu_timetable"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
app:srcCompat="@drawable/dersprog_button" />
<ImageView
android:id="@+id/menu_foodlist"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
app:srcCompat="@drawable/yemek_button" />
<ImageView
android:id="@+id/menu_logout"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginLeft="30dp"
app:srcCompat="@drawable/logout_button" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/menuLayout"
android:layout_alignParentTop="true">
</FrameLayout>
</RelativeLayout>
In this picture ImageViews are not stretched
In this picture ImageViews are stretched via marginLeft
私はmarginleftを使用せずに、第2のように自分のアプリケーションを見てみたいです。
。 –