I'm trying to create an iOS app and I want something like the pics below which when I tap the down arrow, the text and view expand.
I have no idea how it would be possible or even what should I call it.
Expanded one:
Edit:
StoryBoard:
There is a view for Video player top and a ScrollView down which contains an image and a tableview. what i want is that put the above feature(2 pics above) instead of that image. and scroll all image and tableview up to be behind of video player view
Using Autolaout you extend the height of your textview based on content size and your view
You need self sizing cell with tableview automatic dimension you can find tutorial for that
in label set number of lines 2 and line break mode to truncate tail initially ,
on tap of button action you need to set number of line 0 and line break mode world wrap , and use beginUpdate and endUpdate tableview
You have to add action (selector) to the button and in it you have to modify the frame and properties of containting view. Please post some code/storyboard for detailed answer.
Related
I have a simple table view which looks like this
Each button overflows some part to next cell (part of requirement).
I want that overflowing button's click event. How to get that ?
By default its taking it as cell click rather than button click if i click on that overflowing part.
I have created a dummy code which changes button color on click, so it is easy for someone to try it out. same layout.
Thanks
EDIT
Below is the original image , what i am trying to do , for simplicity sake i scaled it down to a button
Lets assume req is u cant change height and cant play around table view separator
You have to implement 'tableView:heightForRowAtIndexpath:` method and return greater value than it has now. Your cells don't have enough height to display buttons fully, and because of that some part of your button hides behind of next cell. You can be convinced easily by checking "Clip subviews" checkbox of your Cell Prototype in the interface builder, and if you will see that buttons will be clipped.
EDIT
Check this: https://github.com/arturdev/test
Subclass UITableView and override hitTest:withEvent: and figure out if point is within the frame of one of the buttons. Return the button if the point is within the frame or just return [super hitTest:point withEvent:event] otherwise.
You can use CGRectContainsPoint and [UIView convertRect/Point:to/fromView:] to make calculation easier.
hitTest:withEvent: is a way for the system to ask the outermost view who will receive the event at a given location.
Make UITableView seperator to None. draw 1 or 2 pixel height label with black background color in cell.
Make cell selection style none in cellForRowAtIndex.
cell.selectionStyle = UITableViewCellSelectionStyle.None
Manage proper autolayout or autoresizing mask.
Just tried with your code.
Download from link
Image
I am creating a screen of an application that contains inside a custom cell one pageControll. It is already working properly but by default his marker comes down the contentView. How can I make the marker in the position I say? In case a little but within the above contentView
this is my screen:
I can think of two possible solutions.
Instead of adding the pageControl to the the cell's content view, add it instead as a child of the red view you have there.
In interface build add a constraint between the bottom of the content view and the pageControl.
Either should achieve the result you're looking for, if I understand you correctly.
I want to divide UITableView into three part like iOS Music App's TableView like following image
I want to divide like above Image's UITableView.
How can i?
make custom cell, in that custom cell put one view having three
imageViews, set images in such a way that it look likes above design.
create 3 images for left,center, right.
leftImage must have border line at right side for looking it as vertical line & rightImage must have border line at left side for looking like it as vertical line or simply you create one center image having border at both side.
for horizontal line you can simply use default cell seperators. if not then set cell seperator
to none & design above 3 images having top or bottom border line .
you can simply design it through the storyboard and assign your custom cell filename to TableViewCell. you can design custom cell like the link given below in comments
Is there a way to insert a TextView inside a customized UIView and then resize the UIView based on the number of lines in the TextView? Something that looks like the message bubbles from the Message app (I believe they are also cells).
This is a git project by Alex Barinov that achieves what you are looking to do with a UITableView. Using a table view, you are easily able to dynamically add next chat "bubbles" to the bottom of the screen and push the old content up.
http://alexbarinov.github.com/UIBubbleTableView/
If you scroll all the way up on the iBook, you can see an apple mark (above search and two buttons). How can you put such image on top of the TableView?
My first guess is that apple just used an image as its background and somehow aligned it right. Am I on right track?
It's a UIImageView, either set as a tableHeaderView (check the docs) with the table given negative-top contentInset, or just added as a subview of the table view itself. The latter's probably simpler—just set the image view's position to something with a negative Y value.