0
Hello I would like to change the layoutgravity of the image, which will always be filled on the sides and at the top. I change the layoutgravity but does not change anything. Example below:
Screen Code:
<LinearLayout 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"
android:orientation="vertical"
tools:context="com.example.aluno.tiposdeenergia.solar"
android:background="@mipmap/background_foto1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageView
android:layout_height="230dp"
android:layout_width="match_parent"
app:srcCompat="@mipmap/energiasolar_foto2" />
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="25dp"
android:layout_marginTop="5dp"
android:fontFamily="monospace"
android:text="Fontes de Energia Sustentáveis no Brasil"
android:textSize="24sp"
android:textStyle="bold|italic" />
<TextView
android:id="@+id/EnergiaSolar_Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:fontFamily="serif-monospace"
android:text="@string/Solar"
android:textAlignment="textStart"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</ScrollView>
</LinearLayout>
you want it to get filled up on the sides or how is it? explains your problem and what you want because you probably won’t even need to touch the Gravity layout
– Brenddon Anjos
is filled up and on the sides and always in the top position
– Pedro Henrique
i try to use the matchparent at the height of the image but it does not fill, only fill all when I put 230dp
– Pedro Henrique
So bro, the image she has the size of her, and when you put in the imageview with the different dimensions of the image she doesn’t fill even no, do the following go in layout-Weight and arrow 1 and tell me if it worked
– Brenddon Anjos
Nothing has changed, even with the height in matchparent or 230dp
– Pedro Henrique
Related (duplicate?): Adjust Image/Bitmap to Imageview or adjust Imageview to Image/Bitmap
– ramaral