I want to make a drop-down list from scratch. Can anyone please tell me how to do so?
You would start with a UITextField and a button to look like a normal closed drop down list. Then when the button is clicked I would add a new view containing a small UITableView for the drop down part. It shouldn't be too hard. However I'd reconsider the need for a drop down box. Its just not something that you have room on screen for, and the UIPickerView is better suited IMHO. Now on the iPad they use a drop down similar to what I described above but it has enough room on the screen to make this practical.
You can use a UIPickerView or a UITableView to have a functionality akin to drop down lists.
Related
If I turn the autocorrection ON, the words get autocompleted, as if I write "wor", I get "word" before I finish writing. I don't want this to happen because I might be writing "world" or any word different than the autocompleted one.
I set Correction off in the Interface Builder and this problem is solved.
The problem now is that I still need the suggestions that appear in a little popover below the incomplete words.
This two features might be different but I don't know how to activate the suggestions.
How can I solve this?
This can be solved with the use of tableview. Create a tableview with the width as of the width of the textfield and height as you like. Place it just below the textfield. Make it hidden initially. When the user starts typing, fetch the array of data that resembles to the typed text and if any exists then, unhide the table view. On the subsequent typing keep on reloading the tableview sections with animations. You should be accurate on hiding, unhiding and then reloading the data on the tableview. I have implemented such thing before. It is really easy and once you get started with it you find it easy.
In the UITextView TextViewDidChange I created a thread that changed the cursor position. This, off course happens after the text view changes. The change of the cursor position triggers the autocomplete without letting me even see that there had been a suggestion.
Can I drag an item (image, rectangle or other shapes ...) and drop it freely somewhere on the screen? I know there is a way to drag and drop items from a GridView to another, but I would like to do it without restrictions (and without Directx).
And I also found only a quickguide for drag&drop, no useful examples, that's why I'm curious.
I had the same problem. After trying to work with Manipulation etc I just gave up and implemented a quick work around.
I just placed my item ( Circle in my case ) into a ListView and allowed the ListViewItems to be dragged. (CanDragItems). I also removed all the styles so it wouldn't look like a ListView.
This way I could drag my ListViewItem (which was just a circle) and drop it somewhere. You don't have to drop it into another ListView.
If you put these property
Drop="imgCart_Drop_1" AllowDrop="True"
on an image for example then you can capture the drop event.
I hope this helps
I'm trying to implement a sort of drag functionality into my app. As a simplistic example imagine I have a 2x2 square of buttons, so four buttons total. Clicking a button will perform some other functionality however I want when they hold and drag one of these buttons for it to do something else (ideally if you drag one button and drop it while in the space of another button the two buttons will swap places, as long as I can get dragging and dropping working the swap should be easy).
I've done some research and followed a few tutorials but seemed to get errors at one step or another with all of those. It seems ListViews and GridViews have some drag and drop functionality in them already , but I had trouble properly arranging my buttons (there are many more than four and they are in very specific positions, like a diagram) inside these views, let alone getting drag and drop working with them.
How would I go about doing this? Ideally I could just tag these buttons as draggable, and then on a drag-drop event check for a drop position, then if the position is valid perform a swap method. I just can't seem to figure out how to make them draggable or how to have an event that checks a drop position.
Thanks.
Easy peasy, create a custom control that looks the way you want it to, set ManipulationMode to TranslateX|TranslateY, handle manipulation delta events to update positioning with something like a Canvas or TranslateTransform and when manipulation completes - either make it click or animate to the new position. From my experience - getting any other manipulations to work with a regular Button class just isn't working and since a button is a really simple control - it is easier to create your own than try to extend the existing one in such cases.
I make some UI under IOS5 that enables to select 1 item from some 5 items.
As a beginner in this platform I am looking for the best solution. First I thought to create a list view which's items can be checked. I could make it, but idi not find a solution 'out of the box' that checks one item by clicking and uncheck all others. Is it the normal way to implement it by code? Or does listview have some kind of 'check-the-clicked-cell-and-uncheck-others' property/method?
I know I can use also picker view as an option selector but I prefer checkable table this time.
Thanks!
There is no out-of-the-box uITableView solution. You would have to handle unchecking the other table view cells programmatically by adding some code to tableView:didSelectRowAtIndexPath:.
I got trouble to add slideshow to my application.
Currently, I have a UIView composed of a segmentedControl.
I made two "views" that I hide or display depending on the selected button.
I'm looking to make a simple slideshow in one of my two views. I made a UIImageView because it is simple to display pictures.
So I'd like to display my pictures one by one and it is possible to move from one image to another by sliding your finger to the right or left (just as in the native app "Photos").
I tried to adapt example codes from the documentation, but without succes.
So I'ml looking for help.
Thanks,
jb crestot
SO, I've actually done this and it's fairly easy. The ingredient that you are missing is a UISCrollView. My implementation did exactly what you describe (allow the user to go back and forth between a set of images).
Basically, add a UIScrollView to your View in interface builder and you will be creating the UIImage views with code (a simple for loop) and setting their images the same way. I did this safely with no memories issues with about 15 images (PNG's). There could be a potential performance issue with this message if you are working with a large number of images (say 40?)
I hope this helps, let me know if you need a code sample to see how this works.
You may consider using a custom class, such as iCarousel, linked below. Each of these views could be your image, and then tapping on them could launch a fullscreen view for example.
Keep us posted!
http://cocoacontrols.com/platforms/ios/controls/icarousel
See apple's page control sample application.