# your custom view class
class Piece(ui.View):
#the did-load method is called after the form (designer) file is loaded...so are views are accessible from code
def did_load(self):
#here you would load a local image...based on the type of chess piece
self['imageview1'].load_from_url('https://image.flaticon.com/icons/png/128/36/36189.png')
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Posts made by scorpid
-
RE: Chess piece on view
-
RE: Chess piece on view
Hi, in the view designer, you can place subviews, so you could place an ImageView to manage the chess piece image. Since your view uses a custom class, you can load the appropriate image by referencing the image subview.
The example below needs some work, but should give a general idea.
# your custom view class class Piece(ui.View): #the did-load method is called after the form (designer) file is loaded...so are views are accessible from code def did_load(self): #here you would load a local image...based on the type of chess piece self['imageview1'].load_from_url('https://image.flaticon.com/icons/png/128/36/36189.png')