1
I’m having doubts about responsive screens on android. I’m almost done with my app, but I’m not getting it to be responsive to various screen sizes. I’m using the Android Studio IDE.
<RelativeLayout 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=".MainActivity">
<Button
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="70dp"
android:layout_marginLeft="30dp"
android:id="@+id/button_home_calcular"
android:background="@drawable/botao_calcular_efeito" />
<Button
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="70dp"
android:layout_marginLeft="205dp"
android:id="@+id/button_home_aluno"
android:background="@drawable/botao_aluno_efeito" />
<Button
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="300dp"
android:layout_marginLeft="30dp"
android:id="@+id/button_home_fluxograma"
android:background="@drawable/botao_fluxograma_efeito" />
<Button
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_marginTop="300dp"
android:layout_marginLeft="200dp"
android:id="@+id/button_home_notas"
android:background="@drawable/botao_notas_efeito" />
</RelativeLayout>
This image is an example of my layout.
Could you complement with some sample code you’re using...
– Rafael Withoeft
There are several ways to make a layout adjustable to various screen dimensions. Each of them depends on the layout content (images for example) and even the type of application. That’s why your question was closed as "too broad". If the question has only to do with this screen post the xml of your layout.
– ramaral
The question is still closed so I can’t answer it. The problem with your layout is that, although you use a Relativelayout, you are, to position the buttons, using fixed positioning attributes such as marginTop, marginLeft and not relative as layout_alignParentLeft, layout_toRightOf, etc.
– ramaral
Hello, how did you manage to make the buttons so round,?
– jessica