How to diable horizontal scrolling of uitable view? [duplicate] - iphone

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Disable UITableView horizontal scroll
Please can any one tell me how to disable horizontal scrolling of tableview..
Kindly help..

If your tablecontentview width is same as your view width it will not scroll in horizontal way but if you want that your tableview should not bounce then you can disable bouncing of your tableview as
m_TableView.bounces = NO;

Related

Horizontal and vertical scrolling in a UITableview [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to make a lineup for a festival. You can see what I want to achieve below here.
You can scroll in every direction ,horizontal - vertical and from left to right corner (don't know the proper word in english).If you scroll in one section ever other section should scroll with it.
My question is know how can you achieve this? I'm searching for days to get this working but don't find a good solution...
The row in the UITableView doesn't scrolls itself inside the UITableView. one solution Is to use an UIScrollView and then inside add the UITableView. This UIScrollView will have the same size that your UITableView have now, but the UIScrollView contentSize property will have the same height but it would have a greater width.
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(x, x, x, x) style:...]
[scrollView addSubview:tableView];
// Set the size of your table to be the size of it's contents
// (since the outer scroll view will handle the scrolling).
CGRect tableFrame = tableView.frame;
tableFrame.size.height = tableView.contentSize.height;
tableFrame.size.width = tableView.contentSize.width; // if you would allow horiz scrolling
tableView.frame = tableFrame;
// Set the content size of your scroll view to be the content size of your
// table view + whatever else you have in the scroll view.
// For the purposes of this example, I'm assuming the table view is in there alone.
scrollView.contentSize = tableView.contentSize;
For better understanding with UITableView scrolling you can follow this two links
horizontally table scrolling
vertically table scrolling
i hope it helps you for better understanding and make familiar with UITableViewDelegate. Thanks

How to find dynamic centre of iOS device screen [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
iOS SDK: Moving the button into the center of screen by code
UIImageView. Zoom and Center to arbitrary rectangle. Can’t determine correct center on screen
I'm trying to centralise an UIActivityIndicator in a UIWebView(which in turn is a subView of a UIScrollView, which also has a UIToolbar element to the left - although the left-toolbar isn't always visible)
Similar questions have been asked before, but the point is in finding the center "dynamically" i.e. on change of orientation as well as presence or absence of the left toolbar.
What's the best approach? Is there any better way to do this than overriding the method shouldAutorotateToInterfaceOrientation?
Center of what btw?
You can access the UIViewController's center as self.view.center
or in your case, UIWebView's center as yourwebView.center
And by giving it resizing elements of top left, activityindicator would center it-selves always.
EDIT :
If you want center of the screen that would be gained by frame like
Consider activity indicator of width and height 30, 30.
(([UIScreen mainScreen].bounds.size.width)/2 - 15, ([UIScreen mainScreen].bounds.size.height)/2 - 15, 30, 30);
Then, set autoresizing elements to none.
Go to size Inspector and remove all the arrows from the Auto-sizing feature.
There can be not general solution to your question. This is because only you know what element in your view you want to ignore or not. The view always stays the same, no matter what element you add to it. So, I suggest getting a rectangle for the part of the view you consider as clear/empty/available and setting your loading indicator in that. Just get the view's whole frame (self.view.frame.size.height) and substract any elements from there. For example
MyIndicator *indicator = [[MyIndicator alloc] initWithFrame:CGRectMake(self.toolbar.frame.size.width + self.toolbar.frame.origin.x, self.topBar.frame.size.height + self.topBar.frame.origin.y, self.view.frame.size.width - self.toolbar.frame.size.width - self.toolbar.frame.origin.x, self.view.frame.size.height - self.topBar.frame.size.height - self.topBar.frame.origin.y)];

How to position UIButton to extreme right of UIToolbar? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to adjust UIToolBar left and right padding
As you see in the attached picture1, there is a bit of padding of some kind preventing the UIButton from going all the way to the right.
How do I position the button all the way to the right so it's touching the right of the screen?
Use flexible Space Bar Button before the button in xib or Storyboard.

How to create resizable view with handlers on sides to stretch or resize in ios? [duplicate]

This question already has an answer here:
Changing View size using user touch input
(1 answer)
Closed 7 years ago.
I am creating an app where user touch the screen and places a rectangle view on screen which he can move or resize by touching its corners like any other crop view . I have done this functionality but i want eight handlers on the sides of that rectangle so that user can use that handlers to resize it. Now i am unable to create such functionality . I tried to add eight buttons as subview on that rectangle view but when resizing when that view increase its size than all eight buttons just change their positions . can anybody help me with this functionality ?
Thanks in advance
Hi i got the answer from here . here is a great class for making resizable view. Great work by the developer
Create resizable view in ios with UITouch
To do this you are going the right way about it.
You need to create a custom view that positions these eight handles depending on the size of the view. When the view changes size you then need to reassess where those handles are so maybe have a function thats called when the view is resized and in here you change the location of each handle just by changing its x and y origin depending on the view size.

Problem regarding draw image [duplicate]

This question already has an answer here:
Closed 11 years ago.
Possible Duplicate:
How to set this Layout in iPhone need Some help
I draw image in imageview.
I have one image view and Button is there.
When i draw something it show like this,
I dont wan't to show drawing on that button.
How can i do that?
There are 2 approaches:
1) You can do this IB:
Drag your UIImageView in IB to bottom of your stack subviews of view where your UIView (where you are drawing) is placed.
2) You can do this in code:
Push your view on the top of views using following method
- (void)bringSubviewToFront:(UIView *)view
For example:
UILabel * labelgreen;
[labelgreen.superview bringSubviewToFront:labelgreen];