How do I get the 0 width to be equal size with 1 and 2
( . ) to be equal width as 3 and = to be equal width with +?
I can't drag the white square (When clicking the UI button) to resize them.
Screenshot of my storyboard:
Follow Steps
Focus on stack view contain the elements "0 . ="
select ". =" element and embed into a stack view
StackView properties must be "Alignment = Fill", "Distribution = Fill Equally" and "Spacing" as per other elements
Option1
Set the StackView to Distribution Fill and then control drag the 0 Button onto the . Button. Select Equal Widths and then set the Multiplier (times 2 since it should be twice the size) in the Size Inspector.
Option2
Put the .Button and the = Button in an equally filled StackView and then the 0 Button and the StackView in another equally filled StackView. This is probably the better option if it's a 50-50 distribution.
I have a tableViewthat passes data with prepareForSegueto a new ViewController when pressed. In that ViewController I have a button that I want to use the tag function on.
Is it possible to set tagvia prepareForSegue?
If row 1 in table view is pressed, destination.button.tag == 1and if row 2 is pressed destination.button.tag == 2 and so on
I have a view Controller that contains filter_View
and a tableView_Players
.
When I press the button "Filter la recherche"
I want the Filter_View to expand this way
and results moving the tableview down
.
How to do that ? thanks in advance :)
If you are using AutoLayout, do following :
1) set vertical spacing from tableView to filterView.
2) set Height Constraint of filterView and set its outlet.
3) Initially that height constraint e.g. heightOfFilterview.constant = x
4) While clicking filter la button set heightOfFilterView.constant = y (Whatever you want).
I have TabController with 2 tabs A &B
Tab A: UINavigationController1-->Controller X--->Controller Y
TAB B: UINaviagtionController2-->Controller A --->Controller B --->Controller C
In the Tab Controller, I have a button that I would like to launch Controller X.
How do I get X with its navigationBbarController? I can get to X, but doesn't show the navigation?
Thanks
I have a scrollview with 5 image views of width 88.
I want the scrollview to scroll to each image view (Not Paging)
and
I want to make an infinite scrollview in iPhone which means the when it scroll to last item it will display a first item next to it..
I have been trying by offset but it stops when move it by offset and also I have used apple street scroller which does not allow me to stop each element in center(just like Picker view)..
First of all, I recommend to use a UITableView so you can maintain the memory usage low. An approach that I had used successfully in a project is the following:
1. List item
Duplicate the content of your cells, I mean if you have 5 items in this way:
| 1 | 2 | 3 | 4 | 5 |
You should add the same (In a table view with reusable engine that's not a big deal) at the end of the table in order to look like this:
| 1 | 2 | 3 | 4 | 5 | 1 | 2 | 3 | 4 | 5 |
2. modify the scrollViewDidScroll with the following:
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView == _yourScrollView) {
CGFloat currentOffsetX = scrollView.contentOffset.x;
CGFloat currentOffSetY = scrollView.contentOffset.y;
CGFloat contentHeight = scrollView.contentSize.height;
if (currentOffSetY < (contentHeight / 6.0f)) {
scrollView.contentOffset = CGPointMake(currentOffsetX,(currentOffSetY + (contentHeight/2)));
}
if (currentOffSetY > ((contentHeight * 4)/ 6.0f)) {
scrollView.contentOffset = CGPointMake(currentOffsetX,(currentOffSetY - (contentHeight/2)));
}
}
}
The code above move the scroll position at top if you almost reach the final of the scrolling; Or if you are almost on the top, moves you to the bottom...
3. That's it.
You can have a look at one of this two options:
If you are registered as a developer, watch the session Advanced ScrollView Techniques from WWDC 2011.
A great tutorial from http://mobiledevelopertips.com/user-interface/creating-circular-and-infinite-uiscrollviews.html
This caused me serious problems for a long time so I really feel your pain. I found this control which should solve your problem: http://www.cocoacontrols.com/platforms/ios/controls/infinitescrollview
I also considered inserting transitions and disabled scroll so it becomes like a slideshow but either way should work.
Here is a short explanation of solution I used to do it.
Lets say you have counter from 0 - 9, then, when you make transition 9 -> 0, you actually spoof another 0 (call it 0') after 9 (in scrollView), make animated transition to 0' and than make non-animated instant transition to 0 that stands on top of scrollView.
You can use iCarousel library for this.
https://github.com/nicklockwood/iCarousel
For anybody else looking for a solution, you can also try this library Infinite Scroll Picker at https://github.com/Seitk/InfiniteScrollPicker/ It's basically drag and drop. I'm using it on a project and it works great.
Implemented a simple infinity scroll in this mini project:
https://github.com/mcmatan/Infinity-tabBar-scroll-view/blob/master/README.md