i have a UiTextView and UiStepper in Xib and i want to zoom the content of textView by using stepper in objective c.thanks
Asked
Active
Viewed 296 times
-1
-
see this https://stackoverflow.com/questions/17159776/uitextview-and-contentscalefactor – Anbu.Karthik Jul 12 '17 at 13:09
-
i am trying to scale the textView size using stepper when i clicked + icon for zoom in and - icon for zoom out in objective c @Anbu.Karthik – Thakur Anil Jul 14 '17 at 13:27
2 Answers
1
For scale(zoom) text
- (void)scaleTextView:(UIPinchGestureRecognizer *)pinchGestRecognizer{
CGFloat scale = pinchGestRecognizer.scale;
createTextView.font = [UIFont fontWithName:createTextView.font.fontName size:createTextView.font.pointSize*scale];
[self textViewDidChange:createTextView];
}
It scales the font size and then recalculates the content size using your code in textViewDidChange
.

Sunny
- 821
- 6
- 17

Vivek Gajbe
- 411
- 2
- 14
0
Try this :
[stepper addTarget:self action:@selector(stepperValueChanged:) forControlEvents:UIControlEventValueChanged];
stepper.tag = indexPath.row;
stepper.stepValue = 1;
stepper.continuous = YES;
stepper.minimumValue = 0;
stepper.maximumValue = 10;
Selector
- (IBAction)stepperValueChanged:(UIStepper *)sender
{
NSUInteger value = sender.value;
txtView.font = [UIFont systemFontOfSize:value];
}

KKRocks
- 8,222
- 1
- 18
- 84