how to replace fragment by click on tabbed or BottomNavigationView item in xamarin.android | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to replace fragment by click on tabbed or BottomNavigationView item in xamarin.android

[Activity(Label = "@string/app_name", Theme = "@style/AppTheme", MainLauncher = true)] public class MainActivity : AppCompatActivity, BottomNavigationView.IOnNavigationItemSelectedListener { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); BottomNavigationView navigation = FindViewById<BottomNavigationView>(Resource.Id.navigation); navigation.SetOnNavigationItemSelectedListener(this); } public bool OnNavigationItemSelected(IMenuItem item) { switch (item.ItemId) { case Resource.Id.navigation_home: return true; case Resource.Id.navigation_dashboard: return true; case Resource.Id.navigation_notifications: return true; } return true; } } }

12th Oct 2019, 4:27 PM
ALAMOUDI, WAEL MAKKI S
ALAMOUDI, WAEL MAKKI S - avatar
0 Answers