question

ozkaro-7807 avatar image
0 Votes"
ozkaro-7807 asked LeonLu-MSFT commented

how to use skiacanvas as a GridView item?

Hellou!
I'm having an issue using skiacanvas as a grid view, what i want to do is draw each path data in a item in the grid but always draws the last path data. and if hide the screen buttons the stroke makes bigger

https://1drv.ms/u/s!AkcqazHa9zXrgbZ6LrcrlOFe53JN2Q?e=GoTFWy

here my code

 public class kanji_detail_activity : AppCompatActivity
             {
                ...
         private string ReadPathString(string unicode)
                 {
                     string[] lines = null;
                     var readpath = from selunicode in dbCon.Table<StrokeDB>() where selunicode.unicode.Contains(unicode) select selunicode;
                     StrokeDB code = readpath.FirstOrDefaultAsync().Result;
                     string data_to_parse = null;
                       
                         if (code.Path.Contains('|'))
                         {
                             int k = 0;
                             lines = code.Path.Split('|');
                             foreach (var lin in lines)
                             {
                                 k = k + 1;
                                 data_to_parse += lin;
                                 strokeList.Add(new StrokeDataProcess(lin, data_to_parse, k.ToString()));
                             }
                         }
         ...
         }
dotnet-csharpdotnet-xamarin
· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Which result do you want? Picture one or picture two? When you hide the screen buttons, the layout will be bigger. If you want to show all of the GridView item, you can try to add Padding for your GridView.

0 Votes 0 ·

About 2 years ago you made a post on Stackoverflow about a default SMS app in Xamarin.Forms. The Github links are no longer active.

I am hoping you'd be kind enough to re-share that repository. Having a codebase to reference would be useful for a project I am working on.


0 Votes 0 ·

You can try to access it again.

0 Votes 0 ·

thanks for reply.

both pictures are wrong, what i want to do is show in each canvas item, the path what split in the string, explaining how is the order of the strokes, but always return the last path in all canvas items
I've tried to create the path from the call of the list instead pass the string in the view and is the same result

 foreach (var lin in lines)
                     {
                         k = k + 1;
                         data_to_parse += lin;
                         strokeList.Add(new StrokeDataProcess(SkiaSharp.SKPath(lin), data_to_parse, k.ToString())) ;
                     }

this is the result what I'm looking for
https://1drv.ms/u/s!AkcqazHa9zXrgbZ9k1vGnPj2Pe0WAg

0 Votes 0 ·

If you want to put all of path what split from the string in the same line, you can try to use Scollview, GridView will change line when item's length over the screen's length.

https://developer.android.com/reference/android/widget/ScrollView

0 Votes 0 ·
Show more comments

0 Answers