i am searching for a way to parse a psd-layout to a nib-file or something like this. I want, that the designer builds a layout and slices this into the different elements. The result should be a ready-to-use XIB-File. ;-)
Are there any ideas how to realize this?
Thanks
You can ask your designer to name the difference slices using a specific nomenclature.
A possibility:
specific_name-class-x-y-width-height
e.g.
LoginButton-UIButton-60-200-120-40
Then a script parsing each file of your export folder will create your xib file which is nothing more than a XML file.
a simple way to do that could be using psd.js
But I think that it will be much simpler to teach your designer how to use Interface Builder ;)
I've heard about snippets (.jsx = javaScript??) which you can use for Photoshop. These scripts could export your images/layer/slices and change the name to their relative position. Maybe this information could be helpful for anybody.
This tutorial explains exactly how to automatically port a Photoshop PSD or Fireworks Layered PNG into an Xcode storyboard. With all your elements placed for you. http://www.youtube.com/watch?v=hB5PJgIrUko&sns=em
write your own photoshop script:
http://www.adobe.com/devnet/photoshop/scripting.html
or, use this service:
http://www.psdtoxib.com/
Related
Is there any software that allows designing the icon of a Modelica component, and then copy into Dymola?
It is hard to draw the picture in Dymola.
A short summary of the answers, there is 4 software support this task:
OMEdit;
MoVE;
InkSpace;
PowerPoint;
Yes, there is MoVE, but it seems development is stopped.
For some tasks OMEdit is better. Properties of graphical elements are nicely presented in a single dialog and you can easily edit the points of lines and polygons.
As an alternative you can use svg and png files, which can be nicely drawn with Inkscape.
Another option for creating icons and info-graphics is to make them in standard packages for drawing, save them in a proper format (e.g., .png) and then use them. This is what I do with my library.
One way I have done it is with powerpoint and wrote a macro that auto-names them: https://github.com/ORNL-Modelica/TRANSFORM-Library/blob/master/TRANSFORM/Resources/Images/Icons.pptm
Next to that is another one for info slides.
Another one worth a go is something like Inkscape (https://inkscape.org/) and then you can run a command line terminal to loop through them all and generate png/jpgs.
The following platform-independent method, i.e. works with arbitrary Modelica simulation environments, is particularly useful for sophisticated icons:
Use LibreOffice Draw for drawing an Icon
For each drawing, produce an image file in one of the desired format according to quality requirements
Include the image file within standard annotation for icons
Here is an example from the library GenKinetics:
An Icon draw in *.gif format: Inhibition Icon
A component employing the Icon: Port_I.mo
I have various .PSD files that compose an interface. I am trying to learn GWT and GWT-Designer. Can anybody point me to a way to import those files with GWT-Designer so that I may code the interface ?
Thank you
GWT-Designer doesn't import PSD files directly. I would look at the various panels and widgets available in GWT Designer and try to map those to the elements in your image file. Since you're learning, start with something simple and move up from there.
I was wondering if there is any way to directly manipulate the XIB/NIB files without the use of Interface Builder. I know its difficult but is there any way. Can you please tell me how can I do that or the internal structure or the documentations available on it? And will it be feasible or better in any other way.
Regards,
Vivek
Xib/Nib files are XML files, you can edit them with every Texteditor.
I wouldn't recomend that tough, if you want more controll over your app, simply create your views Programmatically. A little introduction for doing so might be: http://chris-software.com/index.php/2009/04/29/creating-a-view-programmatically/ further reading to remove nibs completely from your app:http://www.steili.com/wordpress/2009/02/25/building-an-iphone-app-without-interface-builder/
I tried to do it, but Interface Builder refuses to open the resulting file:
alt text http://img81.imageshack.us/img81/7194/screenshot20091102at252.png
"Interface Builder was unable to determine the type of [file name]"
To answer your question (as you put it in the title): Yes, it is. I did it with TextWrangler for a test (moved a widget) and it works like a charm.
I suspect, you also changed something else (encoding, file name) when you were editing the file. You should try it again with a copy of the xib and do a diff between original and result.
It is possible. Just the task's complexity is approaching the complexity of writing an web app in assembler.
Joking. It's highly not recommended. I think this Xib is not your and Interface builder is just not allowing you to use it.
While the XML format of XIB files is intended to be somewhat human readable, XIB files should never be edited by hand. While the file may appear mergable, the object graph is complex and cannot be maintained except when edited within Interface Builder.
Even if it appears to work, this is unsupported and could lead to more complex problems down the road. It is better to instead file enhancement requests on Interface Builder to provide the capability you need, rather than try to hand edit the XML.
I'm trying to separate the views for the different platforms into different subfolders.
I have done this for the layout, at the moment I have the following:
class MoviesController < ApplicationController
layout :site_layout
def site_layout
if(iphone_request?)
"iPhone/movies"
else
"movies"
end
This means that in my action methods I don't need to include :layout, however I do still need to manually include the path to the template.
format.iphone {render :template => 'movies/iPhone/index'}
Is there a way to have the same kind of layout declaration but for templates?
Thanks
Ben
You may want to extend the view_paths so that you can have a special iphone subfolder under views and override templates as necessary. See this tutorial on how to do that.
However, is there a reason you don't want to use the iphone format in the view name (show.iphone.erb) instead of making a subfolder? See martinkl's answer in your other question for details.
I might be off, but maybe it'll help - try checking prepend_view_path.