Can't find new layouts

jacob.7515jacob.7515 USMember
edited April 2013 in Xamarin.Android

Hey

I've been trying to get my program change between activities so i did the following:

created new layout (Layout2)
created new activity (Activity2)

but whne i try to call SetContentView(Resource.Layout.Layout2); inside Activity2 OnCreate(), it cant find the new layout only the Main.axml layout that it created itself.

I tryed dl'ing the Hello, Multiscreen projekt and add a new layout+activity, but cant get it to work there either.

I fell like im soo close at nailing this but 2 hours of google search and still not working:(

any help would be appreciated

Posts

  • StevaSteva RSMember ✭✭✭

    You need to build the project after you make layout, then it will show in intellisense. If you build it and it doesn't show you probably have some error in that layout.

  • jacob.7515jacob.7515 USMember

    AWESOME THX!!!!!!^^

    Building it worked, you just made my day <3

  • iamaurousiamaurous PHMember ✭✭

    @Steva said:
    You need to build the project after you make layout, then it will show in intellisense. If you build it and it doesn't show you probably have some error in that layout.

    Hi Stevan, got the same issue here, I created a new layout but those doesn't show in intellisense, only the Main.axml shows. Tried rebuilding the project but to no avail. Here's my code in my new axml file anyway:

    <?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"
        android:background="#67C9FA"
        android:weightSum="100"
        android:minHeight="25px"
        android:minWidth="25px">
        <EditText
            android:id="@+id/FirstName"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginBottom="10dp"
            android:paddingLeft="20dp"
            android:hint="First Name"
            android:textColor="#929497"
            android:background="#FFFFFF" />
        <EditText
            android:id="@+id/LastName"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginBottom="10dp"
            android:paddingLeft="20dp"
            android:hint="Last Name"
            android:textColor="#929497"
            android:background="#FFFFFF" />
        <EditText
            android:id="@+id/Email"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginBottom="10dp"
            android:paddingLeft="20dp"
            android:hint="Email Address"
            android:textColor="#929497"
            android:background="#FFFFFF"
            android:inputType="textEmailAddress" />
        <EditText
            android:id="@+id/Password"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginBottom="10dp"
            android:paddingLeft="20dp"
            android:hint="Password"
            android:textColor="#929497"
            android:background="#FFFFFF"
            android:inputType="textPassword" />
        <Button
            android:text="Sign Up"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:id="@+id/bntSignUp"
            android:layout_gravity="center"
            android:layout_weight="15"
            android:layout_marginTop="25dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginBottom="10dp"
            android:textSize="20dp"
            android:textStyle="normal"
            android:background="#929497" />
    </LinearLayout>
    

    Thank you

Sign In or Register to comment.