Solution 1 :
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 .
Problem :
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
Comments
Comment posted by Junior Jiang
Hi, welcome to SO ! You can show the code of
Comment posted by VenomSnake03
@JuniorJiang-MSFT Thanks for your answer, i will comment back later with the code, im focussing more on C# than xml for the moment, so i dont really know how all of that works yet. Is it correct that in VS 2019 you can not drag buttons freely anymore? If that is still an option, could you please tell me where i could find it? Thanks again and i will definitely respond back with the code.
Comment posted by Junior Jiang
Hi , it depends on which layout used in xml . You can have a look at my shared answer .
Comment posted by using android Designer
You can refer
Comment posted by VenomSnake03
Thank you very much, this definitely solved my problem. Thanks for also including more educational material for me to learn from. This will definitely come in handy.
Comment posted by Junior Jiang
@VenomSnake03 Glad be helpful , remember to mark the answer when you have time .Then other people will know how to solve it 🙂