(iphone) aqgridview question. how to make shelf? - iphone

I'm using aqgridview to create a book-shelf like UI.
I can place image and title for image fine (with the ImageDemo example provided in aqgridview).
I want to place 'shelf' image where the image title is. (as in http://itunes.apple.com/ca/app/rivet-for-ipad/id375055319?mt=8)
I can set the background color of the label for title but the shelf background image won't be there where there's no cell in the first place.
Hence shelf image doesn't cover the entire screen width.
How can I stretch the shelf image?
Thank you

i'm also using AQGridView for a book grid with shelves, i found the best and fastest way to do this is simply use a UITableView.
Create a UITableView and add the shelves images as rows (Configure UITableViewCell)
Set the AQGridView backgroundView to the UITableView
_gridView.backgroundView = _tableView
you can use
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
to use different shelf graphics for different shelfes
but i'm guessing you already found way by now.

Related

Chat Bubbles with UITableViewCells

I want to have chat bubbles with a custom bubble image to be used to display chat messages.
As a beginner, I am thinking of having a UITableView with custom cells. The cell will have bubble image. And within that image, I want to have chat message, date&time and status.
Also, the size of bubble image will shrink or expand depending on message size.
How do I achieve this?
Is there any good tutorial to achieve this?
Please help.
Thanks in advance.
I would highly advise this library:
http://www.cocoacontrols.com/platforms/ios/controls/stbubbletableviewcell
I think it will suit your needs.
You can of course have a structure but the it will be quite odd because the size of table will be according to size of biggest cell , also the size of table will have to be defined during allocation so what you will be doing is placing an image according to the size of text and it will be quite odd as rest of cell will be simple white.
Now . You will have to implement the logic to change the size of image in layoutSubviews Method of UITableViewCell as You can get the size of text from the chat message using sizeWithFont method of NSString PLease see String size in label
and then you will have to set the frame of each cell or image in the delegate method of uitableview "- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath "
You can add as many labels as required in custom UITableViewcell (or controls).
Custom cell Tutorial
Alternatively you can create a custom view where in you can define methods to add subviews with the image as background cropped to match the size of message , below each message and create an array of strings or dictionary of string to keep a track of messages from different users.
check this - http://idevrecipes.com/2010/12/08/stretchable-images-and-buttons/ - and use the same method, but your image in custom table cell will be stretchable vertically - with some cap in the middle.. and then add this uiimage as a background to the cell

Creating Image Grid using UITableView in ios

Here i need the grid layout for creating similar to the photo album page,But in that page i am having thousands of images so that, i am using uitableview
GridView can be done using UITableView. One way u can do it is have a custom UITableViewCell & have 2 imageViews with tag 1 & 2. That way when u access that view in cellForRowIndex... you can extract that imageView & populate...
You can do this or u can use what others have already done -
how to design and create a GridView using UIScrollView or UITableView
How To Create A Gallery on iOS
https://stackoverflow.com/questions/6430012/ios-grid-view-with-section-headers
create a custom cell extending UITableViewCell.
Add UIImageView to it. assign images on - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Changing grouped tables border radius

Is it possible to change how radius of the grouped UITableView? The rounded corners are way to drastic for my design.
I believe that the only way to do this is to provide your own background images for your table cells. You can provide 3 images to have a rounded feel to the UITableView like Apple Does.
in
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
set the cell's backgroundView to a UIView with the image you want based on the cell index. This will allow you to set the Top, Middle and Bottom.
This is a pretty good article
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
just be sure to dequeueReusableCellWithIdentifier:
No, it isn't. You can duplicate it though with a standard tableview and a couple custom background images.
You have to change both cell.backgroundView and cell.selectedBackgroundView with a view of your choice.

Look like iPhone inbuilt contact applications image selection

I have created an application in which i have to add users to the sqlite database.
Now the problem is I want the look of the standard iPhone Contact application Where while adding user we have the width of first cell smaller than other cells and the image before that cell..
Can you please give me the idea how such thing is possible.
How to make one cell small and rest others of normal size..
Thanks for any help in advance
There are three UITableViewDelegate messages you can listen for to adjust height
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
However, even thought I didn't write Contacts.app I have a feeling they are also using
- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath
To adjust the views as well. Remember, you don't have to pack everything into a single monolithic custom table view cell. You can create multiple custom table view cells and load them each appropriately depending on the index path.
The contact detail view is a grouped tableview. Each cluster of cells is a section. The top section is a single custom cell with two subviews that look like squashed tableview cells. The left view shows the contact's photo. The right view shows the name.
To reproduce, create a custom UITableView subclass and lay it out like you want either programmatically or in Interface Builder. Then in the tableview delegate's cellForRowAtIndexPath check indexPath.section and return the proper row for the section.
It appears that the Contacts app uses a custom tableHeaderView when presenting the contact details with an image and label. A similar implementation is included in the sample project iPhoneCoreDataRecipes. The RecipeDetailView loads a separate nib in tableViewHeaderView that is used to set the tableView.tableHeaderView property. Have a look at RecipeDetailViewController.{h,m} and DetailHeaderView.xib. When the Contacts app switches to editing mode, the headerView appears to be swapped out for another view that has a button and a tableView with a single cell. This will allow you to set up a separate tableViewDelegate to handle the Name parts of the contact and a delegate to handle the address / telephony details.

iPhone OUTBOX like table design

I would like to do a design similar to iPhone outbox.
It displays 3 lines of text in a single column. The first line is large and bold, the second line is of normal size and font and third one is grey color.
Also a time is displayed in the first line with a different font color.
I know to create a two line display using subtitle cell type but i am not sure how the outbox design is achieved.
Have they used a custom view with different labels and put that view inside the cell?
Thanks
You are on the right track. Create three custom labels and add them as subview to the cell.
You can either do that directly in your
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
or by subclassing UITableViewCell. Alternatively, you can design your custom cell in Interface Builder.