Jump to content

Im trying to make an app using a guide directly from Microsoft https://msdn.microsoft.com/en-us/library/dn879698.aspx just to get used to c# development for android

however when i try to build it I get errors or all the icons will overlap each other even without the code. I have tried to re position manually but i cannot do it as it either puts it below or above the first object. I am using latest Xamarin and Java JDK 7.1 installed by Xamarin. Please help code is in spoiler. I also specifically get errors at the "p1:layout_to(left/right)of="@id/x" it says could not define or something line that

Spoiler

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"
    p1:minWidth="25px"
    p1:minHeight="25px"
    p1:layout_width="match_parent"
    p1:layout_height="match_parent"
    p1:id="@+id/relativeLayout1"
    p1:background="#545454">
    <TextView
        p1:text="Search By Zip Code"
        p1:layout_width="wrap_content"
        p1:layout_height="wrap_content"
        p1:id="@+id/ZipCodeSearchLabel1"
        p1:layout_marginLeft="10dp"
        p1:textColor="@android:color/white"
        p1:textStyle="bold" />
    <TextView
        p1:text="Zip Code"
        p1:layout_width="wrap_content"
        p1:layout_height="wrap_content"
        p1:layout_below="@id/ZipCodeSearchLabel1"
        p1:id="@+id/ZipCodeLabel"
        p1:layout_marginTop="15dp"
        p1:layout_marginLeft="10dp" />
    <EditText
        p1:inputType="number"
        p1:layout_width="wrap_content"
        p1:layout_height="wrap_content"
        p1:layout_below="@id/ZipCodeLabel"
        p1:id="@+id/zipCodeEntry"
        p1:layout_marginLeft="10dp"
        p1:layout_marginBottom="10dp"
        p1:width="165dp"
        p1:layout_marginTop="15dp" />
    <Button
        p1:text="Get Weather"
        p1:layout_width="wrap_content"
        p1:layout_height="wrap_content"
        p1:layout_toRightOf="@id/zipCodeEntry"
        p1:id="@+id/weatherBtn"
        p1:layout_marginLeft="180dp"
        p1:layout_alignBottom="@id/zipCodeEntry"
        p1:layout_marginTop="20dp"
        p1:width="165dp" />
    <TextView
        p1:text="Location"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/locationLabel"
        p1:layout_marginLeft="10dp"
        p1:layout_marginTop="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/locationText"
        p1:layout_marginLeft="20dp"
        p1:layout_marginBottom="10dp" />
    <TextView
        p1:text="Temperature"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/tempLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/tempText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
    <TextView
        p1:text="Wind Speed"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/windLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/windText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
    <TextView
        p1:text="Humidity"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/humidtyLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/humidityText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
    <TextView
        p1:text="Visibility"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/visibilityLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/visibilityText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
    <TextView
        p1:text="Time of Sunrise"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/sunriseLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/sunriseText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
    <TextView
        p1:text="Time of Sunset"
        p1:textAppearance="?p1:attr/textAppearanceSmall"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/sunsetLabel"
        p1:layout_marginLeft="10dp" />
    <TextView
        p1:textAppearance="?p1:attr/textAppearanceMedium"
        p1:layout_width="match_parent"
        p1:layout_height="wrap_content"
        p1:id="@+id/sunsetText"
        p1:layout_marginBottom="10dp"
        p1:layout_marginLeft="20dp" />
</RelativeLayout>

 

Thanks in advance9_9

Hello

Link to comment
https://linustechtips.com/topic/687413-c-xamarinvisual-studio-errors/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×