Answer the question
In order to leave comments, you need to log in
How to set the location of the view in the layout?
Hey! I load different photos in an ImageView, it looks something like this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".View.RepostView"
android:orientation="vertical"
android:padding="10dp">
<ImageView
android:id="@+id/iv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/iv_background"
android:contentDescription="@string/iv_description"
android:padding="5dp"
android:scaleType="fitCenter"
android:layout_marginBottom="5dp"/>
<EditText
android:id="@+id/et_description"
android:layout_width="match_parent"
android:layout_height="130dp"
android:background="@drawable/et_background"
android:elevation="4dp"
android:inputType="textMultiLine|textNoSuggestions"
android:padding="5dp"
android:textColor="@android:color/white"
android:textSize="14sp"
android:gravity="top"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<Button
android:id="@+id/button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:onClick="onClickSave"
android:text="@string/b_save" />
<Button
android:id="@+id/button2"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="4dp"
android:onClick="onClickRepost"
android:text="@string/b_repost" />
</LinearLayout>
</LinearLayout>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question