Disapiring ui elements in visual studio 2019 + Xamarin editor.

1

I am making my first program for android with buttons in Visual studio 2019 with Xamarin, and all element, excluding sirst, that i add to my app disapirs from graphical editor and test builds after some time and some compilations, despite coad for this being still in the file. After that this all this happens to all elements, that i want to add. Also i can add only one element by drad and drop.

1

Show your XAML code please - probably you should put all controls into some kind of container, or there will be only one visible?

0
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">
    <TextView
        android:text="Text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:minWidth="25px"
        android:minHeight="25px"
        android:id="@+id/textView1" />
    <Button
        android:text="Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/textView1"
        android:id="@+id/button1"
        android:layout_marginTop="94.0dp" />
    <Button
        android:text="Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/textView1"
        android:id="@+id/button2"
        android:layout_marginTop="41.5dp" />
</RelativeLayout>
0

Also this was on empty project, and on it i tested also code, i copied from internet:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TextView
        android:text="0"
        android:textSize="50sp"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/txtNumber"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="20dp" />
    <Button
        android:text="Increment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/btnIncrement" />
    <Button
        android:text="Decrement"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/btnDecrement" />
</LinearLayout>

and this didnt work , howether it works on app with single wiew.

0

This is NOT Xamarin, but pure Android layout code.

1 użytkowników online, w tym zalogowanych: 0, gości: 1