1
我有我的菜單,我有十個項目,但準備好時,他們沒有完全顯示,只有每個項目的第一個字母。列表菜單時出錯xamarin android
我能做些什麼來解決它?
從我的菜單代碼,我只是有麻煩顯示文本完全
private void SetUpViewPager(ViewPager viewPager)
{
TabAdapter adapter = new TabAdapter(SupportFragmentManager);
adapter.AddFragment(new Fragment1(), "Início");
adapter.AddFragment(new Fragment2(), "Serviços");
adapter.AddFragment(new Fragment3(), "Cidade");
adapter.AddFragment(new Fragment4(), "Polícia");
adapter.AddFragment(new Fragment4(), "Cultura");
adapter.AddFragment(new Fragment4(), "Esporte");
adapter.AddFragment(new Fragment4(), "Geral");
adapter.AddFragment(new Fragment4(), "Caderno de esportes");
adapter.AddFragment(new Fragment4(), "Vedeos");
adapter.AddFragment(new Fragment4(), "C Especiais");
viewPager.Adapter = adapter;
}
public class TabAdapter : FragmentPagerAdapter
{
public List<SupportFragment> Fragments { get; set; }
public List<string> FragmentNames { get; set; }
public TabAdapter (SupportFragmentManager sfm) : base (sfm)
{
Fragments = new List<SupportFragment>();
FragmentNames = new List<string>();
}
public void AddFragment(SupportFragment fragment, string name)
{
Fragments.Add(fragment);
FragmentNames.Add(name);
}
public override int Count
{
get
{
return Fragments.Count;
}
}
public override SupportFragment GetItem(int position)
{
return Fragments[position];
}
public override ICharSequence GetPageTitleFormatted(int position)
{
return new Java.Lang.String(FragmentNames[position]);
}
}
你有沒有在你的'TabLayout' xml'app:tabMod e =「可滾動」和「app:tabGravity =」fill「'? – Yupi
是----> –
JOSE
它的工作原理,謝謝 – JOSE