In this example we will learn how we can set the layout file
to “.axml” file to an activity class file. With this we will be able to comes
to know which activity file belong to which layout file.
So for this we will use SetContentView function which belong to Activity class. This we will define inside the activity class file with in the OnCreate . So here is the code.
So for this we will use SetContentView function which belong to Activity class. This we will define inside the activity class file with in the OnCreate . So here is the code.
[Activity(Label = "Activity1", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
protected override void OnCreate(Bundle
savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.Main);
}
}
|
Please check the above highlighted piece of code.
0 comments:
Please let me know your view