简体   繁体   English

如何在 Objective-C 中创建类似收据的纸张背景

[英]How to create a receipt-like paper background in Objective-C

I am creating an iPhone app that I feel needs to have a receipt background on the landing tab.我正在创建一个我认为需要在登陆选项卡上具有收据背景的 iPhone 应用程序。 Mint has this on their mobile app for both Android and iOS. Mint 在他们的 Android 和 iOS 的移动应用程序上都有这个。 I can't for the life of me think of how I would do this without drawing and duplicating a bunch of triangles on the bottom of a white container.如果不在白色容器的底部绘制和复制一堆三角形,我这辈子都无法想象如何做到这一点。

The attached image should show you what I'm aiming to do.所附图片应该向您展示我的目标。

EDIT: It appears I can't attach an image.编辑:看来我无法附加图像。 Go here - http://dl.dropbox.com/u/189423/photo.PNG Go 在这里 - http://dl.dropbox.com/u/189423/photo.PNG

UPDATE : I have decided to use an image - Now, how would I go about using a custom image for the top, tiling along the y-axis for the content area, and then another on the bottom?更新:我已经决定使用图像 - 现在,我将如何 go 将自定义图像用于顶部,沿 y 轴平铺内容区域,然后在底部使用另一个? As far as I can tell, a UIView only allows for one background image.据我所知,UIView 只允许一张背景图片。 Any help?有什么帮助吗?

Use a background UIImage, with bounds set for tiling.使用背景 UIImage,并设置平铺边界。 The triangles at the bottom are likely just using the image alpha channel.底部的三角形可能只是使用图像 Alpha 通道。

You need to have images for:您需要有以下图像:

  1. Top cell of the tableView tableView 的顶部单元格
  2. Middle cells中间细胞
  3. Bottom cell of the tableview表格视图的底部单元格

and set them as backgroundView for each cell.并将它们设置为每个单元格的背景视图。

If your tableView doesnt grow then you can have single image set as tableView backgorund如果您的 tableView 没有增长,那么您可以将单个图像设置为 tableView backgorund

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM