Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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>
@stesvis

This comment has been minimized.

Copy link

@stesvis stesvis commented Nov 29, 2019

@jfversluis I see the camera view in the page but no red line (basically it's just a camera and it's not scanning) even if i set IsScanning="True".
Any idea why?

@jfversluis

This comment has been minimized.

Copy link
Owner Author

@jfversluis jfversluis commented Nov 29, 2019

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