Link array of ImagesViews to TableLayout
Does anyone know, if you have an array of ImageViews[n][n], how to connect the array to a TableLayout? Furthermore, after it's displayed in the tableLayout, is there a way to tap the images in the table layou开发者_如何转开发t and swap places with the adjacent tile with a specific label?
Thanks!
You will just need to construct your TableLayout manually using addView()
.
You might want to check out GridView which provides an easy way to "link" data using Adapters.
Edit GridView may not work for you because it doesn't specify the number of items per row.
You might also think about making a custom View and rendering your images to a Canvas using the graphics calls in your onDraw()
method.
精彩评论