I simply want to link a label to a slider in order for it to display the current value of that slider. This is my first time working with Objective-C, and the problem seems far more complicated than in Java or C#.
This is the first thing you will see demonstrated in the Stanford CS193P videos on iTunes - if you want to do it in Interface Builder look no further.
Related
I have seen a few grids made with UITableView but I don't really like how close together each cell is to the other. If there is a way of creating a grid system like the home screen on an iphone (the screen after it is unlocked) if would be great. I don't need an exact solution but a point in the right direction, maybe a set of libraries to look through would be great. I am running xcode 4.4.1
Thanks!
The key is UIScrollView has a paging mode (since could have more buttons than fit in the view). It's covered here's in Apple ocs:
http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/UIScrollView_pg/ScrollViewPagingMode/ScrollViewPagingMode.html
If you use that, each 'page' would have n buttons/views that when clicked would call a protocol/delegate call back for the consumer with the data to handle and it would evenly layout the UIView/buttons across that page view. Contact me if you want my sample.
You probably don't want to require iOS6 as a minimum requirement but if you do, you can do as H2CO3 suggested in the comment and us UICollectionview. Here's a tutorial: http://www.raywenderlich.com/22324/beginning-uicollectionview-in-ios-6-part-12
There's also some open source launchers that you can look into their code. Here's some (I'm sure there's more).
http://www.cocoacontrols.com/platforms/ios/controls/sespringboard
Code is at: https://github.com/sarperdag/SESpringBoard
Also: http://www.cocoacontrols.com/platforms/ios/controls/openspringboard
Use UICollectionView. You can create grid type views using that. It is available in iOS 6.
If you can target iOS 6+, use UICollectionView. It's one of the best new things in iOS for years and it will be as important as UITableView.
The layout you're asking for is only a few lines of code.
NSHipster has a good explanation of UICollectionViews and Ray Wenderlich has a good tutorial.
(There's lots of example code out there, but here's a very simple example project I did recently for another question involving UICollectionViews)
So I need to make a simple app in Xcode 4.2, I already have the layout set, there is just one thing I'm stuck on. I need to make a calculator in which someone could input several numbers which would go into an equation then when you click submit the result pops up on the page.
For example
Estimated Hourly rate:
Estimated material cost:
Estimated Hours:
then you would click submit and on the next page you would see
Approximate cost:
Now the thing I need to know is how to use that formula in Xcode and get the next screen to display that cost. Any help is appreciated!
Start with Empty View template, in IB add labels and UITextField for each of input value, then add UIButton. Connect everything to your variables in *.h, synthesize them in *.m file. Create IBAction for UIButton, where you read values user entered in UITextFields, perform your formula then display it to user.
I would suggest to You reading some basic tutorials, it's pretty simple App.
If you are looking for a tutorial about how to make a calculator on iPhone, check
iPad and iPhone Application Development iTunes U free courses here: http://itunes.apple.com/us/itunes-u/ipad-iphone-application-development/id473757255
It is on iTunes U by Paul Hegarty from Standford University. This is a great tutorial used by lots of developers, and I highly recommand this course. The very first or two classes was how to implement a calculator. That is a simple mathmatical calculator which is probably different from what you need, but you can get some useful ideas from it.
Hope this helps.
I am curious as to whether or not there is an open source solution to replicate the flash button in the iOS camera applicaiton.
I have seem many other apps use this, but there doesn't seem to be a native way, so I assume there is a common source out there.
It is possible to get the flash button by using UIImagePickerController class, but most of the camera apps out there don't seem to be using this (or perhaps they subclass it, which is against apple's terms).
I am looking for a way to replicate the expanding behavior of the button. Any thoughts?
It doesn't sound too hard.
The way I'd do it is to separate the right curve of the button (as images), and make a UIView that has the left part of the button and the right curve as subviews.
When it's tapped, slide the right curve and animate the extra buttons in.
You could use a stretchable UIImage (see UIImage documentation) and then just animate the frame changing.
In the Apple 2010 WWDC Sample code (downloadable via iTunes, otherwise I'd post it here), there are several sample applications which use this control. They call the class ExpandyButton. I realize I'm answering my question, but hopefully someone out there can find this useful.
While looking for a similar solution to this problem I came across this code which was extremely helpful. Similar to ExpandyButton it fit my needs better.
https://github.com/ddebin/DDExpandableButton
Looking for some catalog/gallery(not UICatalog, just images), where I can see preview of each UI element in iPhone SDK, along with corresponding class name(eg datetime picker, calendar, the black switch bar on bottom). This will give me rough idea on which UI elements I can use in my app and go read about corresponding class.
I would highly recommend reading the iPhone Human Interface Guidelines Document. It's produced by Apple, and has a ton of great advice on how to craft interfaces as well as descriptions and guides for the standard UI elements.
You can also check out the UIKit Framework Reference, and the wiki at CocoaDev. If you need images, teehan+lax have a great PSD template for mockups
I'm slowly working through the iPhone Application Programming Guide and although it's been great I was wondering if anybody has seen any resources that match class names/widgets with a visualisation/diagram.
For example when I'm reading about Containers and UITableView's it'd be very helpful if I could see what the widget actually looked like. Thanks.
Once you get started with development, the UICatalog example project can also be very helpful. It shows each type of UI element (buttons, sliders, images, etc...) and you can look at the source to get a feeling for how it is used.
You can see how the controls look like in interface builder. You won't see the exact classname, but it's pretty straightforward. A progress bar is a UIProgressBarView, a button is a UIButton, etc.