Skip to content

Instantly share code, notes, and snippets.

@jfversluis
Created August 22, 2018 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfversluis/8e9acedafc3ef3fd6e279d9ccf08ff53 to your computer and use it in GitHub Desktop.
Save jfversluis/8e9acedafc3ef3fd6e279d9ccf08ff53 to your computer and use it in GitHub Desktop.
Custom layout for scanning barcodes
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ZXingSample.PartialScreenScanning"
xmlns:zxing="clr-namespace:ZXing.Net.Mobile.Forms;assembly=ZXing.Net.Mobile.Forms"
Title="Partial screen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<BoxView Grid.Row="0" BackgroundColor="Chocolate"/>
<zxing:ZXingScannerView Grid.Row="1" x:Name="_scanView" OnScanResult="Handle_OnScanResult" IsScanning="true"
WidthRequest="200" HeightRequest="200" />
<BoxView Grid.Row="2" BackgroundColor="Blue" />
</Grid>
</ContentPage>
@jfversluis
Copy link
Author

The red line is part of the ScanningPage, think of it as an example view that is provided for you. The ScanningView allows you to customize that. It will provide you nothing out of the box, you can draw lines or whatever you want yourself though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment