. Net language APP development platform-Smobiler learning logs: How to Implement Message styles in the circle of friends ?, Aggregatorer
First, scycler is a development platform that uses the. Net language to develop apps in the VS environment. It may be more convenient than Xamarin. 1. Target Style
The following operations are required to achieve the effect:
1. Drag a MicroBlog control from "Smobiler Components" on the toolbar to the form interface.
2. Use code to add the content displayed on the mobile phone interface
Load Event code: VB: Private Sub TestMicroBlog_Load (sender As Object, e As EventArgs) Handles MyBase. load Try Me. microblog1.defauserusername = "Wei bin" Me. microblog1.defauseruserid = "Wei bin" contentArray (0) = "Dedicate your youth to the one behind you" + vbCrLf + "brilliant City" + vbCrLf + "to this dream" + vbCrLf + "we pay the price" userarray (0) = "Wei bin" picturearray (0) = 0 InitialMicroBlogData () Catch ex As Exception MessageBox. show (ex. message, Sub () Me. close () End TryEnd Sub
C #: private void TestMicroBlog_Load (object sender, EventArgs e) {try {this. microblog1.defauserusername = "Wei bin"; this. microBlog1.DefaultUserID = "Wei bin"; contentArray [0] = "Dedicate your youth to the one behind you" + System. environment. newLine + "brilliant City" + System. environment. newLine + "for this dream" + System. environment. newLine + "we pay the price"; userarray [0] = "Wei bin"; picturearray [0] = "0"; InitialMicroBlogData ();} catch (Exception ex) {MessageBox. show (ex. message, (Object s, MessageBoxHandlerArgs args) => this. close ());}}
Other code: VB: Dim contentArray (4) As String Dim userarray (4) As String Dim picturearray (8) As String Dim voice (5) as String Private Sub InitialMicroBlogData (Optional count As Integer = 10, Optional ByVal insert As Boolean = False) Dim user As String = userarray (0) dim picturerandomnum As Integer = 6 Dim imageList As New List (Of String) imageList. add (6) Dim item As New MicroBlogItem (user, user, contentArray (0), DateTime. now. toString) item. pictures = imageList item. ILikes. add (userarray (0), userarray (0) If insert = False Then Me. microBlog1.BlogItems. add (item) Else Me. microBlog1.BlogItems. addTop (item) End If NextEnd Sub
C#: string[] contentArray = new string[5]; string[] userarray = new string[5]; string[] picturearray new string[9]; string[] voice = new string[6]; private void InitialMicroBlogData(int count = 10, bool insert = false) { string user = userarray[0]; List<string> imageList = new List<string>(); imageList.Add("6"); MicroBlogItem item = new MicroBlogItem(user, user, contentArray[0], DateTime.Now.ToString()); item.Pictures = imageList; item.ILikes.Add(userarray[0], userarray[0]); if (insert == false) { this.MicroBlog1.BlogItems.Add(item); } else this.MicroBlog1.BlogItems.AddTop(item); } }
Ii. Mobile phone effect display