Is there any way to customize the datepicker used in iphone?
I want to change height & width of it.
Can we change the background color, font color of it?
Please help if anybody has done before.
Thanks in advance ...
The size cannot be changed. There are other questions concerning this and several ways to fake it, moving it partially offscreen or putting other views in front partially obscuring portions or adding background images to make it look larger. The best approach is to use it as-is or write a custom picker.
Or you can create your own picker ;)
I created this component that allows you to do this really easily: http://dev.doukasd.com/2011/04/infinite-scrolling-dial-control-for-ios/
Related
I'm not asking for the full implementation here.
I'm asking because I don't even know what it is called, if somebody could at least tell me the
class I can work with that.
thanks
There is no built-in class for this. However, it can be accomplished using a UIWindow and some views. You should browse http://cocoacontrols.com, they have quite a few open-source versions of this.
For example:
MBProgressHUD: https://www.cocoacontrols.com/controls/mbprogresshud
DejalActivityView: https://www.cocoacontrols.com/controls/dejalactivityview
MMProgressHUD: https://github.com/mutualmobile/MMProgressHUD
It's just a partly transparent UIView with black background and a corner radius of about 15, containing an activity indicator and a label. You can create it in a .xib for easy layout and then load it as needed.
I am pretty new to iPhone development and currently working on an application which includes a view that performs a simple numerical calculation. In particular, the user enters 3 or 4 values into text fields and the view displays the result. Something along the lines of http://www.moneychimp.com/calculator/compound_interest_calculator.htm
What is the nicest way to achieve this? I am currently using simple UITextFields and a UILabel for the result but it doesn't look nice or "native-like". What UI object would be best to use?
Thank you!
It's entirely up to you. You're using the right classes for actual input- it comes down to how you choose to style those classes. I'd suggest looking at the documentation for UIView and CALayer (youView.layer, and include QuartzCore framework in your project).
A good start might be to choose a color scheme, a background for your app, and the look and feel you're shooting for- this will inform your styling. Try looking for apps that you think are elegant and attractive, and boil down what they do and what you like about them.
I'd say;
use a grouped table style (with the white tables with round corners on a blueish striped background)
embed settings values directly in the cell (aligned to the right) as much as possible
you can show a relevant keyboard (text, numbers) or picker view to let the user pick values, directly when they tap the cell. Use sliders and switches where relevant.
You may want to take a look at http://www.inappsettingskit.com/, we are currently investigating it for the same purpose and it seems to do the job
You can use either a UISlider or a UIPickerView if some of your values have limits.
You can use UISwitch for toggles.
You can also switch the default keyboard for your textfields to be numeric.
Other than that you seem to be on the right track.
Also, sometimes putting a view inside a scrollview makes things seem cooler even if its only one page. The auto bounce on scrollviews is kind of cool.
I have several UIButtons, I'm trying to bulk change the font for all of them in InterfaceBuilder, but when I change the font, they auto-resize to the original image dimensions instead of what I had them set to, screwing up the layout. I would like to avoid having to resize and move everything around again any time I change the font. I could just set the font in a loop in code, but it seems redundant.
Is there a setting to stop this from happening?
This issue doesn't seem to occur in Xcode 4.0 or above.
Should anyone still be using a lesser version of Xcode I would suggest updating.
I know you can do it on Mac OS X with NSAttributedString but I haven't had much luck with that on the iPhone.
I'm trying to basically do a string like "$200" except the dollar sign is replaced by a custom symbol.
Here's a post I found regarding NSAttributedString on the iphone. Have you read through it? There're some good ideas there.
I think you can take a look at the Three20 library, it helps you to put HTML texts with inline images into labels and table cells.
You can create a custom table cell and use the interface builder to layout the image and the string in the correct position, if you want to add more labels and images, feel free to do so, but remember to add value to the Tag so that you can later on set/get the values of the labels and images. Instead of using the default table cell, use this custom table cell. Hope that helps.
I think you can't do what you want to do.
but nothing is impossible friend.
One way i can sugges you the :
--> Use UIImageView for your custom image at appropriate place.
--> Take UITextField along with it to display your actual price.
it will solve your problem.
NSAttributedString does not exist in UIKit on the iPhone.
If you can find a Unicode glyph to use in place of your custom symbol, that is the easiest solution. There are glyphs for every currency symbol in the world if that's what you're trying to do.
If you must use an image, you can't mix images and text with a built-in class. You will have to create your own UIView subclass and implement drawRect: yourself to draw the image and the text separately.
I'm displaying a PDF file using UIWebView, and I want to do 2 things:
I want to make the page fit the phone screen without the user has to double tap to do that
I want to remove the margin with gray shadow around the displayed PDF
Thanks for helping
I don't think this will help much, but I think your best option is to render the PDF to an image (of decent DPI) and show the image instead. I do this for an app, but we do that server side using ImageMagick - don't know how you might do that in obj-c. Also note that a mostly-text PDF will be much larger (filesize) when rasterized.
However, you might also try to embed the PDF in HTML page and load that HTML in the WebView - that may at least avoid the gray border/artboard.
webView.transform = CGAffineTransformScale( webView.transform, 1.25, 1.25 );
2 - Checking the Scale Pages to Fit box in IB sorted this for me
I would also like to know the answer to 1.
I guess you want to know how to display the PDF in the same way as when opening as attachment in mail, where the navigation bar only appears on a tap and the status bar also disappears?
You can also use Quartz to do it, as explained here : http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
Where has CGAFFineTransformScale been all my life?
Seriously, that is a big help. However, it worked better applying it to webView.scrollView.
Finally, is there a similar command to change the offset of the content as well as the scale?