Пожалуйста, откройте файл TheFragment.cs
, для которого NameSpace установлено значение BottomNavigationViewPager
, измените его на пространство имен вашего проекта tab_slide_bottom
namespace tab_slide_bottom.Fragments
{
public class TheFragment : Fragment
{
string _title;
string _icon;
public static TheFragment NewInstance(string title, string icon)
{
var fragment = new TheFragment();
fragment.Arguments = new Bundle();
fragment.Arguments.PutString("title", title);
fragment.Arguments.PutString("icon", icon);
return fragment;
}
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
if (Arguments != null)
{
if (Arguments.ContainsKey("title"))
_title = (string)Arguments.Get("title");
if (Arguments.ContainsKey("icon"))
_icon = (string)Arguments.Get("icon");
}
}
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// res
var view = inflater.Inflate(Resource.Layout.fragment_layout, container, false);
var imageView = view.FindViewById<ImageView>(Resource.Id.imageView1);
int resID = (int)typeof(Resource.Drawable).GetField(_icon).GetValue(null);
imageView.SetImageResource(resID);
var textView = view.FindViewById<TextView>(Resource.Id.my_title);
textView.SetText(_title, null);
return view;
}
}
}
Вот ваш код, выполняющий GIF.
Вот ваш проект, вы можете скачать его.
https://github.com/851265601/Xamarin.Android_ListviewSelect/blob/master/tab_slide_bottom.zip