Using Visual Studio to develop a Xamarin cross platform APP. I have specific Android code I have added to the Android specific build. I get the CS0117 error when trying to compile. I have a 'V2T.axml' file in the Resources/layout folder. The line in the CS code with the error is:
SetContentView(Resource.Layout.V2T);
Any idea what is wrong?
Also get 2 more CS0117 errors for problems with 'Resource.Id" does not contain definition errors - but I have defined those two resources.
Any ideas?
CS:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// set the isRecording flag to false (not recording)
isRecording = false;
// Set our view to: V2T.axml
SetContentView(Resource.Layout.V2T);
// get the resources from the layout
recButton = FindViewById<Button>(Resource.Id.btnRecord);
textBox = FindViewById<TextView>(Resource.Id.textYourText);
V2T.axml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="3">
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout1"
android:layout_weight="1"
android:gravity="center">
<Button
android:text="Start Recording"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnRecord" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout2"
android:layout_weight="1">
<TextView
android:text="Your text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView1"
android:layout_marginLeft="5dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/textYourText"
android:textColor="#ffedf01d"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/linearLayout3"
android:layout_weight="1" />
</LinearLayout>