This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
samples/XCT.Sample/Pages/Views/TabView Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 18
18
TabStripBackgroundColor =" Blue"
19
19
TabStripHeight =" 60"
20
20
TabIndicatorColor =" Yellow"
21
+ TabIndicatorWidth =" 10"
21
22
TabContentBackgroundColor =" Yellow" >
22
23
<xct : TabViewItem
23
24
Icon =" triangle.png"
Original file line number Diff line number Diff line change @@ -976,7 +976,7 @@ void UpdateTabIndicatorWidth(double tabIndicatorWidth)
976
976
{
977
977
if ( tabStripIndicator != null )
978
978
{
979
- tabStripIndicator . WidthRequest = tabIndicatorWidth ;
979
+ tabStripIndicator . WidthRequest = TabIndicatorWidth > 0 ? TabIndicatorWidth : tabIndicatorWidth ;
980
980
}
981
981
}
982
982
@@ -1076,16 +1076,14 @@ void UpdateTabIndicatorPosition(ItemsViewScrolledEventArgs args)
1076
1076
{
1077
1077
var progress = ( offset - contentWidthCollection [ previousIndex ] ) / ( contentWidthCollection [ nextIndex ] - contentWidthCollection [ previousIndex ] ) ;
1078
1078
var position = toRight ? currentTabViewItem . X + ( currentTabViewItemWidth * progress ) : currentTabViewItem . X - ( currentTabViewItemWidth * progress ) ;
1079
-
1080
- tabStripIndicator . TranslateTo ( position , 0 , tabIndicatorAnimationDuration , Easing . Linear ) ;
1081
1079
}
1082
1080
}
1083
1081
}
1084
1082
1085
1083
void UpdateTabIndicatorPosition ( View currentTabViewItem )
1086
1084
{
1087
1085
var width = TabIndicatorWidth > 0 ? ( currentTabViewItem . Width - tabStripIndicator . Width ) : 0 ;
1088
- var position = currentTabViewItem . X + ( width / 2 ) ;
1086
+ var position = currentTabViewItem . X + ( width / 2 ) - 1 ;
1089
1087
tabStripIndicator . TranslateTo ( position , 0 , tabIndicatorAnimationDuration , Easing . Linear ) ;
1090
1088
}
1091
1089
You can’t perform that action at this time.
0 commit comments