Skip to content

Instantly share code, notes, and snippets.

@bjorncoltof
Last active August 29, 2015 13:59
Show Gist options
  • Save bjorncoltof/10596587 to your computer and use it in GitHub Desktop.
Save bjorncoltof/10596587 to your computer and use it in GitHub Desktop.
public StylablePagerTabStrip(Context context, IAttributeSet attrs)
: base(context, attrs)
{
var styledAttributes = context.ObtainStyledAttributes(attrs, Resource.Styleable.StylablePagerTabStrip);
// Style 1
for (var i = 0; i < styledAttributes.IndexCount; ++i)
{
var index = styledAttributes.GetIndex(i);
switch (index)
{
case Resource.Styleable.StylablePagerTabStrip_indicatorColor:
TabIndicatorColor = styledAttributes.GetColor(index, Android.Resource.Color.White);
break;
}
}
// Style 2
TabIndicatorColor = styledAttributes.GetColor(Resource.Styleable.StylablePagerTabStrip_indicatorColor,
Android.Resource.Color.White);
styledAttributes.Recycle();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment