How to make a tableView that can slide horizontal? [closed] - ios

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I want a tableView that slide horizontal.
Just look like what scrollView can do.
Can I?Thx

Please have a look at this link
- (void)easyTableView:(EasyTableView *)easyTableView setDataForView:(UIView *)view forIndexPath:(NSIndexPath *)indexPath
By calling the above method you can do it.

You can achieve this by adding UITableView in UIScrollView. Extend the UITableView width how much you want and set UIScrollView Content size as same as UITableView frame( width and height) in implementation file.Then run your code.I hope this will work.Please let me know if you have any queries.

Related

How to scroll cells only and not the entire tableview? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How do you disable tableview scrolling but enable cells to scroll within the section similar to how path for iPad does their friend and and notification cells, they are collapsable but the cells under the section only scroll within the section as in the section does not move to the top of the device but remains in its position.
There is no such controls available in iOS.
Possibly it is a customized UITableView. According to your description, each section of that table will contain another UITableView not simple UITableViewCell. That's why it have the feature you specified.
I had seen some open-source controls with similar feature, but forgot the name of those controls.
Your question is too broad, its better if you can add more details. But I will give you a rough answer to my understanding of your problem. What you can do is use UITextView in side your tableview cell and depending on the scenarion you can disable the scroll. It is recommended you keep only one scroll view scrollable at one time. UITableView is also inherits from UIScrollView. You can set the scroll disabling to your gesture handle methods or in a expanded cell scenario. To set scroll disable you can set scrollEnabled property to no.
Refer to http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html#//apple_ref/occ/cl/UIScrollView

how to prevent resizing subview outof superview [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
A UIImageView object is in UIView.
UIImageView *foreview = //
UIView* backview = //
/* some preccess */
[backview addSubView:foreview];
Thus foreview is backview's subview.
I am going to resize and rotate the backview so that don't out of foreview.
How to code?
You can set superview.clipsToBounds=YES so that it will clip the subviews which goes out of bounds.
subviews will rotate with superview automatically.
if you don't want foreview rotate with backView, you shouldn't add it as subview.

iOS. Apply another scroll animation when UIScrollView is scrolling [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have UIScrollView with verticall scroll and a button which doesn't belong this scrollview and calls animated moving of this scrollview aside (not scrolling).
If I touch up this button and the scrollview is scrolling at the same time then app waits when the scrollview's animation is finished and then calls the animation from the button.
How to make these animations working simultaneously?
Or maybe are there any ways to stop all the scrollview animations except of checking all the subviews (because there are could be a lot of various scrollviews)?
Solved by calling an animation directly without performSelector:withObject:afterDelay:
But sometimes this wouldn't work

Repositioning programmatically added uibuttons on orientation change [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I'm programmatically adding UIButtons to my view and I want to reposition them based on the orientation change.
I'm creating buttons by running 2 for loops for rows and cols and within the second for loop:
I'm assigning some properties and unique tags for each button. (Ex. Best way to build 10x10 grid of UIButtons?)
I'm detecting orientation change by listening to willAnimateRotationToInterfaceOrientation and was hoping to call buttons by based on their tag to move them to a new position.
I need to keep the state of the buttons so I can't remove them. It has to be repositioned.
Any suggestions? Thanks.
There are three ways to do this.
1) Using Autoresizing masks: Using this approach you need not do anything and the buttons automatically reposition based on the autoresizing masks set for the button with respect to its superview.
2) Second approach is to reposition the button after the rotation of the super view. You can write a method to calculate the new frame for the button based on the new width and height of its super view after rotation. There are rotation callbacks like
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
3) You can also implement below method in button's superview and reset the frames of your button
- (void)layoutSubviews
Hope this helps.
Use this:
UIButton *button = (UIButton *)[self.view viewWithTag:1]; // change viewWithTag to your buttons tag number. Now you can use button to position it anyway you want.
button.frame = CGRectMake(x, y, w, h); // x, y, width, height

How to add a slider to move downward in view? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I am new to iOS programming, so I hope its not a stupid question to ask. I have to add ten different buttons in my view programmatically. I know how to add buttons programmatically, but my buttons won't fit within the view so some of them have to be present below the viewable height of the view, so I want to add the buttons such that the user can slide upward and downward to move across the view. How can this be done?
There are a number of standard UI elements UIKit provides that help handle displaying more content than the screen can display at any one time:
UICollectionView
UIScrollView
UITableView
You may benefit from some of the automatic layout and formatting provided by the UICollectionView but from your description it sounds as though either the UIScrollView or UITableView would be best suited for your scenario.
UIScrollView
The UIScrollView acts as the user's viewport into the underlying view it contains and provides complex panning and zooming functionality by default. It is highly configurable and you can prevent zooming functionality if you do not need it.
Just make sure to place your view inside the UIScrollView within Interface Builder and set the contentSize property. Setting a contentSize larger than the bounds of UIScrollView should enable scrolling automatically. To enable zooming have your UIViewController implement the UIScrollViewDelegate:
#interface MYViewController : UIViewController <UIScrollViewDelegate>
#end
Then ensure to return your view in the viewForZoomingInScrollView: method:
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return theViewContainingTheButtons;
}
UITableView
The UITableView is specifically designed to display a list of items that can be vertically scrolled if its content is taller than the size of the view.
A UITableView is composed of a number of UITableViewCells, each of which could contain one of the buttons you wish to display. Apple's Table View Programming Guide for iOS covers most aspects of the UITableView.
Conclusion
The UITableView approach focuses specifically on what you have asked and neglects that there may be other content in the view hosting the buttons. It also means that you would have to change your existing dynamic button placement code and write new code to work with table views. In reality it's likely that the UIScrollView is what your looking for but I wanted to provide exposure to other UI elements you may not have been aware of that could be used to achieve what you have described.
Good luck!
You need t use a special element, called a UIScrollView. It will handle all this automatically. Here's a link to the docs:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
You can use the UIScrollView.
Instead of adding UIButton to UIView addd then to UIScrollView and set UIScrollView contentSize.
Fore more help : UIScrollView from Apple.

Resources