Instantly share code, notes, and snippets.
Alex, Mobile App Development Enjoyer. Love working in .NET.
-
Infotechnics
- United Kingdom
-
00:03
(UTC +01:00) - alexduffell.com
- @Axemasta
Axemasta
/ ButtonOverScrollView.xaml
Last active
February 2, 2018 16:46
XAML Code that demonstrates how you can add a button over a scroll view for a Xamarin app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:ScrollViewFormatting" | |
x:Class="ScrollViewFormatting.ScrollViewFormattingPage"> | |
<ContentPage.Padding> | |
<OnPlatform x:TypeArguments="Thickness"> | |
<OnPlatform.iOS>0,20,0,0</OnPlatform.iOS> | |
</OnPlatform> |
Axemasta
/ ButtonOverScrollView.xaml.cs
Last active
February 5, 2018 10:23
C# Code that demonstrates how you can add a button over a scroll view for a Xamarin app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xamarin.Forms; | |
using System; | |
namespace ScrollViewFormatting | |
{ | |
public partial class ScrollViewFormattingPage : ContentPage | |
{ | |
public ScrollViewFormattingPage() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create button | |
MGSwipeButton *swipeButton = MGSwipeButton buttonWithTitle:@"Title" icon:[UIImage imageNamed:@"your_image"] backgroundColor:[UIColor clearColor]; | |
//Create view (to use as a mask) | |
CGFloat cellHeight = 90; //return your tableview cell height here | |
CGRect buttonFrame = CGRectMake(0, 0, cellHeight, cellHeight); | |
UIView *swipeButtonView = [[UIView alloc] initWithFrame:buttonFrame]; | |
//Create gradient layer (I'm using a custom method to do this) | |
//This methods creates a gradient layer and adds it to my swipe button |
NewerOlder