In order to move the BarcodeView to another position on the screen rather than centered it is advised to extend the default BarcodeView and override calculateFramingRect in order to change the position.
If we want to decorate this barcode view using the default DecoratedBarcodeView, we run into the following problem:
// Pass on any preview-related attributes
barcodeView!!.initializeAttributes(attrs)
Since the newly created customBarcodeView is not part of this package, the protected function initializeAttributes(attrs) can't be called. This blocks the use of a custom barcodeView.
If we make this function public, we can use all the same code but with a modified barcodeView.
Description of the problem:
In order to move the
BarcodeView
to another position on the screen rather than centered it is advised to extend the defaultBarcodeView
and overridecalculateFramingRect
in order to change the position.If we want to decorate this barcode view using the default
DecoratedBarcodeView
, we run into the following problem:Since the newly created
customBarcodeView
is not part of this package, the protected functioninitializeAttributes(attrs)
can't be called. This blocks the use of a custom barcodeView.If we make this function public, we can use all the same code but with a modified barcodeView.
Which library version are you using? 4.3.0