Smobiler如何模仿微信朋友圈的消息樣式-創(chuàng)新互聯(lián)

這篇文章給大家分享的是有關Smobiler如何模仿微信朋友圈的消息樣式的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

我們提供的服務有:成都做網(wǎng)站、網(wǎng)站制作、成都外貿(mào)網(wǎng)站建設、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、甘肅ssl等。為千余家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的甘肅網(wǎng)站制作公司

一、目標樣式

Smobiler如何模仿微信朋友圈的消息樣式

我們要實現(xiàn)上圖中的效果,需要如下的操作:

1.從工具欄上的”Smobiler Components”拖動一個MicroBlog控件到窗體界面上

Smobiler如何模仿微信朋友圈的消息樣式

2.用代碼添加手機界面上顯示的內(nèi)容

Load事件代碼:

VB:

 Private Sub TestMicroBlog_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  Try
   Me.MicroBlog1.DefaultUserName = "偉斌"
   Me.MicroBlog1.DefaultUserID = "偉斌"

   contentArray(0) = "把青春獻給身后那座"+ vbCrLf + "輝煌的城市" + vbCrLf + "為了這個美夢" + vbCrLf + "我們付出著代價"
   
   userarray(0) = "偉斌"

   picturearray(0) = 0

   InitialMicroBlogData()

  Catch ex As Exception
   MessageBox.Show(ex.Message, Sub() Me.Close())
  End Try
End Sub C#:
 private void TestMicroBlog_Load(object sender, EventArgs e)
 {
  try
  {
   this.MicroBlog1.DefaultUserName = "偉斌";
   this.MicroBlog1.DefaultUserID = "偉斌";

   contentArray[0] = "把青春獻給身后那座" + System.Environment.NewLine + "輝煌的城市" + System.Environment.NewLine + "為了這個美夢"+ System.Environment.NewLine + "我們付出著代價";
   
   userarray[0] = "偉斌";

   picturearray[0] = "0";

   InitialMicroBlogData();
  }
  catch (Exception ex)
  {
   MessageBox.Show(ex.Message, (Object s, MessageBoxHandlerArgs args) => this.Close());
  }
 }

其他代碼:
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
 Next
End 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);
  }
 }

二、手機效果顯示

Smobiler如何模仿微信朋友圈的消息樣式

Smobiler如何模仿微信朋友圈的消息樣式

Smobiler如何模仿微信朋友圈的消息樣式

感謝各位的閱讀!關于“Smobiler如何模仿微信朋友圈的消息樣式”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

本文題目:Smobiler如何模仿微信朋友圈的消息樣式-創(chuàng)新互聯(lián)
網(wǎng)頁URL:http://muchs.cn/article18/diesgp.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計、小程序開發(fā)、微信公眾號App設計、用戶體驗、云服務器

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)