Android 플랫폼 용 탭에 이미지를 표시하기위한 customrenderer를 만들었습니다. 이제 어떤 탭이 선택되었는지 보여주는 밑줄을 어떻게 제거 할 수 있는지 알고 싶습니다. 또한 사용자 정의 렌더러를 만드는 방법에 대한 정보를 얻을 수 있습니까? YouTube에서 보였지만, 둥근 모서리를 가진 예는Xamarin forms : android에 대한 CustomTabRenderer로 선택된 탭의 파란색 선 숨기기
namespace Plopsa.Android
{
public class CustomTabRenderer: TabbedRenderer
{
private Activity _activity;
protected override void OnModelChanged(VisualElement oldModel, VisualElement newModel)
{
base.OnModelChanged(oldModel, newModel);
_activity = this.Context as Activity;
}
// May put this code in a different method - was just for testing
public override void OnWindowFocusChanged(bool hasWindowFocus)
{
// Here the magic happens: get your ActionBar and select the tab you want to add an image
ActionBar actionBar = _activity.ActionBar;
if (actionBar.TabCount > 0)
{
ActionBar.Tab tabOne = actionBar.GetTabAt(0);
tabOne.SetIcon(Resource.Drawable.icon_tab1);
ActionBar.Tab tabTwo = actionBar.GetTabAt(1);
tabTwo.SetIcon (Resource.Drawable.icon_tab2);
ActionBar.Tab tabThree = actionBar.GetTabAt(2);
tabThree.SetIcon(Resource.Drawable.icon_tab3);
ActionBar.Tab tabFour = actionBar.GetTabAt(3);
tabFour.SetIcon(Resource.Drawable.icon_tab4);
}
base.OnWindowFocusChanged(hasWindowFocus);
}
}
동일한 결과 probl 너 ... 그럴 수있어? –
Xamarin에서 API 레벨 23을 사용하면 ActionBar.Tab가 더 이상 사용되지 않습니다. – 476rick