How to use the Photoshop PSD design file in your xCode? - iphone

I'm going to creat an iOS app from UI design to implementation, I want to make my app looks better, so i googled a lot and find people saying to create a PSD file with your app views first, so here comes to my question:
1) If i had that PSD file, how do i use it in my app?
2) Is there a general way to use that PSD file for all the elements I created?
Thank you very much.

The PSD File contains your photoshop readable source material and cannot be used in your iOS application. You have to export / save your PDF files save a PNG or jpeg to use it.

You can export the PSD elements to XCode using a photoshop script. this is easy and simple. All you need to do is follow the steps and it will import the files to your .storyboard file.
PSD to Xcode Script by TampestVision

You will need to do some slicing, i.e. divide the interface described in the PSD into smaller PNG images.
You will probably need
The designer who made the PSD.
Adobe Photoshop.
These are the broad steps that you need to take.
The designer needs to tell you what each element of his design is supposed to do.
As a developer you will need to decide how each element is going into your app (Button, Label, image, table)
Pick out the components you need for each element (outline, fill, shadow, etc)
Choose the corresponding layers,in the PSD, to those components.
save those layers for web(Choose PNG-24, keep transparency)

Related

Create iphone interface from psd

For every developer arrives the day to improve the user interface experience because apps are evalutated mainly from the ui carefulness.
So, i've took a look around the websites and I found some psd where to start to desing my apps.
My question is: How to transform a psd prototype to a well-working app?
I don't unserstand how a mockup can help a developer to build a ui...
Can someone make me some clear the situation?
Well, I'd be careful to make a distinction between the graphics an app uses and the actual User Interface. Certainly the graphics are part of the UI, but the UI is soooo much more than that. Depending on how it is done, photoshop mock ups can be simple graphics you can use for your interface to complexes 'scenes' describing how the app functions. In the latter case, the mock-up can be useful for UI design, in the former case it just gives you pretty images to use (which can certainly be useful).
But to more directly answer your question, most people take 'slices' (individual pieces) of the photoshop image and export them as .png images (or .jpg). If the .psd file doesn't already have the images 'sliced', look up 'photoshop image slicing' on Google. You can then import them into Xcode and use them as background images for the controls you want to use. Especially since iOS 5.0, images can be used for a lot of controls. Also, you'll probably want to make sure you make the image resizable with proper UIEdgeInsets. This will allow the image to resize without pixilation by setting an area that can be tiled within the image.

Default-Portrait.png for iPad: any way to make the file size smaller?

I'm making a Universal App using MonoTouch, and I'm adding my Default-Portrait.png file. That file alone (a 768x1004 .png file) is adding 711k to the size of the app. My app itself is only about 7 megs, so it's adding 10% just for the splash screen.
I could easily make this thing an 80k jpg file instead of a png, but the device doesn't seem to look for a .jpg file. Does anyone have tips for reducing the size of this launch art?
At this point, I'm thinking I might just leave the launch art out and load my own jpg and display it as soon as I have the ability to. That'll keep my app size down, but it's not as nice as having the launch art scale in immediately like most apps do.
Hmmm...given the screen of the iPad and the visual quality users are expecting, I'd just leave it like that.
But if you do want to reduce the disk space, try going to Project > Edit Project Settings > Build (tab at top), and searching for a parameter called "Compress PNG Files." Make sure that's checked. It'll run the pngcrush utility before loading the file onto disk (check the size of your IPA archive after to see if it had any effect).
pngcrush is nice as well, however that will not reduce the quality of you image. If reducing the quality of the image is an option for you, then you might try this tool: http://www.punypng.com/ - or just use an image editing tool to "optimize" the image ...
I recommend pngout if you want to really squeeze those PNGs down, and this won't cost you any quality. It simply removes unnecessary metadata (like pngcrush) and uses its own compression algorithm which is compatible with the regular decompressor used in PNG (zlib). It's really slow, though.
A simpler option is to try "Save for web" in your image manipulation program of choice. Exporting from Acorn (not just the regular save) sometimes gives me vastly smaller files. This is especially true for default images which have large, uniform areas in one colour (screenshots, a small logo in the middle of a black screen).
Is there any reason why you want to reduce the file size that badly? I don't think it matters in your case. I just checked 3 of my apps and the Default.png (of various portrait/landscape varieties) is between 29KB and 422KB, so whilst yours do seem a little heavy, your still way under the 3G download limit.
Are you positive it's adding that much to the size of the app? Did you compare a before and after?
Xcode uses pngcrush on the images for you. I know because I just tried to substitue jpegs for pngs and got the following result:
So, in short, there's not a lot to be done except simplify the image beforehand. Xcode will handle the rest.

Edit my signature in PDF file in my iPad application

In my iPad application I want to add signature in my pdf file.
I already do perform following steps:
Open pdf in UIView (zooming is not implemented yet).
Add one transparent subview (UIImageView) and draw signature on that.
Save all screen using UIGraphicsGetImageFromCurrentImageContext() as a image.
Convert and save the image as a pdf.
This is works fine but pdf quality is very poor.
But now I want to add a signature/image as a pdf metadata. Same as a markup and commenting features of PDF.
Is there any help or sample code is available for the same?
It should be possible to improve the quality of the output by skipping the image/pdf conversion, but afaik there's no lib that will help you editing the metadata of a pdf on the iPad (at least, none that's freely available).
Depending on what exactly you want to do, you may have to write a parser from scratch to know what exactly you have to append to your document to see the wanted effect:
It is very easy to append data to a pdf, but it has to be "registered" in the right locations so that a reader can use this information.

Dynamic graphics rendering on the iPhone?

What I want to achieve is some way of supplying dynamically generated visual content that the user of a device could interact with - touch icons, text links, images etc embedded within some graphic image generated either on the phone or on a server. I would need, pinch, zoom, rotate functionality aswell.
Is it possible to render graphics dynamically within the iPhone's UI? So, for example, would it be feasible to supply an XML file to a device and have that render a custom map within the device? Would you have all the pinch-zoom, rotate and click on icons type functionality of a normal UI?
Alternatively, could I pre-render a png on a server and supply that to the device?
Any ideas or suggestions are appreciated.
Look into Quartz2D to help you do the custom drawing, it should do pretty much anything you want to do....
Sure, any of those are possible.
You'll probably need to write some code to interpret your XML file and generate an appropriate UIView and then embed that in the window.
And you're totally welcome to download images and display them in a UIImageView.

Create a PDF for iPhone, how to?

I'm trying to write a eBook, for the iPhone, using PDF format.
The problem is, I can't create a PDF with 5 cm x 5 cm (example).
I've tried Adobe Acrobat Pro 9. Didn't work, since it is not possible to custom the paper size.
I've tried Pages 08, but it's also not possible (it's possible to set the custom size, but it doesn't work, might be a bug).
I've tried Microsoft Word. The generated PDF is a mess... Doesn't work right.
So.. I can't create a PDF, with a custom paper size. This is nuts... There must be a tool or something that works right.
Anyone knows any tool that works well?
Thanks
On the Mac (since the underlying drawing system Quartz is based on the same ancestor as PDF), you can always generate PDFs by doing Print->Save as PDF...
This generally gives good results.
I have only a suggestion, but maybe open office?
Given that the iPhone resolution is 320 x 360px with a resolution of 163ppi we need to optimise print settings before exporting our document to PDF. I’m tipping most people will view their document with the iphone orientated in landscape mode so we’ll base our document width on 360px.
So here’s the settings you need to use when exporting or printing your document to PDF:
Width: 125mm x 225mm.
That’s it. Now just print your document to PDF using a PDF printer driver like doPDF and email the document to your iPhone.
Have a look at latex. You can typeset the document to any size that you want. http://www.latex-project.org/