I am trying to make a simple android app by following this tutorial right here: https://youtu.be/5CgQUbnf1Qk
In this video, the guy just seems to drag a button onto his app, and doesnt need to do any realignment for it to be where he wants it to be. He is using VS 2017, and i am using VS 2019, now the problem is when i tried to follow his example, my button goes over the text bar, and i have not found a way to get the button to go under the text bar like in the video. Does anyone know how i can fix this, please? Thanks
You can have a look at Xamarin.Android Layouts , there is a LinearLayout you can have a try . If you set android:orientation="vertical"
and drag Button
below TextView
, then it will show as your wants .
The Xml
code will look like follow :
<?xml version="1.0" encoding="utf-8"?>
<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">
<TextView
android:text="Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:fontFamily="monospace"
android:minWidth="25px"
android:minHeight="25px"
android:id="@+id/textView1" />
<Button
android:text="Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button1" />
</LinearLayout>
The effect of user-interface :
Aout using the Xamarin.Android Designer , you can have a look at this doc .