想要水平对齐两个网格视图 [英] would like to align two gridviews horizontally

查看:84
本文介绍了想要水平对齐两个网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想水平对齐两个网格视图





i want to align two gridviews horizontally


pdfTable = New PdfPTable(1)
          Phrase = New Phrase()
          pdfTable.DefaultCell.Padding = 5
          pdfTable.WidthPercentage = 50
          pdfTable.HorizontalAlignment = Element.ALIGN_RIGHT
          pdfTable.DefaultCell.BorderWidth = 1
          pdfTable.SpacingBefore = 15.0F
          cell = New PdfPCell(New Phrase("For Post office use only"))
          cell.BackgroundColor = New iTextSharp.text.Color(240, 240, 240)
          cell.Padding = 5
          pdfTable.AddCell(cell)
          For x As Integer = 1 To 5
              cell = New PdfPCell(New Phrase(""))
          Next
          pdfDoc.Add(pdfTable)
          pdfTable = New PdfPTable(2)
          Phrase = New Phrase()
          pdfTable.DefaultCell.Padding = 3
          pdfTable.WidthPercentage = 20
          pdfTable.HorizontalAlignment = Element.ALIGN_Left

          pdfTable.DefaultCell.BorderWidth = 1
          pdfTable.SpacingBefore = 15.0F
          Dim _Contact As New ArrayList
          _Contact.Add("Date of Posting")
          _Contact.Add("Company Name")
          _Contact.Add("Customer Name")
          _Contact.Add("Telephone Name")
          _Contact.Add("Customer Signature")
          For x As Integer = 0 To _Header.Count - 1
              pdfTable.AddCell(_Contact(x).ToString)
              pdfTable.AddCell("")
          Next
          pdfDoc.Add(pdfTable)

推荐答案

尝试对齐两个网格视图表示可疑或错误的UI和代码设计。但是如果你真的需要一些内容放在水平对齐的两个网格视图中,你显然会尝试将两个网格视图并排放置?不要想:整个视图如何与一个网格视图不同?因此,该解决方案可以在两个内容的公共网格视图上使用。



-SA
The attempt to align two grid views indicates a questionable or bad UI and code design. But if you really need some content which you put in two grid view horizontally aligned, you apparently try to put two grid views side by side? Not think: how the whole view would be different from just one grid view? So, the solution can be using on common grid view for both piece of content.

—SA


这篇关于想要水平对齐两个网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆