Hello,
The best solution to this problem is to use the BoxView
as the bottom border of the button.
It works and is concise enough.
On Xamarin.Forms, you can make the combination of Button
and BoxView
into a control by using ContentView
for easy reuse.
<ContentView.Content>
<StackLayout Orientation="Vertical"
Spacing="0">
<Button Text="Click here"
BorderColor="Transparent"
BorderWidth="0" />
<BoxView HeightRequest="1"
HorizontalOptions="FillAndExpand"
VerticalOptions="EndAndExpand"
Color="Blue" />
</StackLayout>
</ContentView.Content>
The Xamarin.Forms ContentView class is a type of Layout that contains a single child element and is typically used to create custom, reusable controls.
Please refer to Xamarin.Forms ContentView to get more details.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.