Adding a button at the bottom of JSQMessagesCollectionView - ios

I am newbie in iOS. Sorry for my English. Actually I want a button at the bottom of my JSQMessagesCollectionViewenter image description here. I have tried to put it like "drag" and "drop". But it doesn't work there. I know there must be a silly mistake which I am doing with the logic. But I need someone's help to guide me the correct way to do it. Thanks in advance. :)

JSQMessagesCollectionViewController was deprecated I would suggest you to replace it with something else as soon as you can. MessageKit for example.

THis is out side the scope of the JSQ library. I guess it could be in the scope of the library depending on what the button does but JSQ really only helps when it comes to chat. So if the CollectionView you have displayed is the chat part of your app you could add a button in the inputBar but the screen shot does not seem to indicate that. Other wise what you are doing should be pretty strait forward. You could add a button via StoryBoard add Constraints to pin it to the bottom of your screen and hook up the outlets for it to do the action you desire. Or you could do it programmatically in your ViewController. That is about all the help that can be provided with the information given. If share more of you code we may be able to provide more guidance.

Daniel is saying right this is out of the scope of the jsq library still if you want to add Button or other view i will suggest you to add it programmatically to your JSQMessagesViewController SubClass like if i am understanding your question you can add view above the JSQMessagesViewController's Subclass's inputToolBar as -
UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, self.inputToolbar.frame.origin.y - self.inputToolbar.frame.size.height, self.view.frame.size.width, 55)];
v.backgroundColor = [UIColor redColor];
[self.view addSubview:v];
now then you have to change the position of view / button each time keyboard appear or disappear as inputbar becomes first responder. As far as i am understanding your question i think this will help.
Although You can also change the XIB of InputToolBar and Can customize your Button in storyboard(xib) then do changes in the class of InputToolBar according to your needs.

Related

What is the most standard approach to creating a separate menu which can be displayed over a single view controller

Apologize in advance as I'm still new to Xcode.
I have a 2D game build entirely in one viewController. I would like to add both a start menu and in game menu to the game. I assume the best way to do this is through another instance of a viewController? Any advice or suggestions would be very helpful.
First place a UIView on your Xib or UIStoryboard.
Put 2 buttons on it and make their connections and outlets.
The view you want to open is view_Menu.( let us consider)
Now for managing view you need to do this:
view_Menu.frame = CGRectMake(xAxis, yAxis, self.view.frame.size.width, 150);
[self.view addSubView: view_Menu];
In xAxis and yAxis you can put your values.
Now when you click any button inside the menu view you can simply call this method:
[view_Menu RemoveFromSuperview];
So it will help to provide you that you want. A bit of things that you can put a background image or make some custom animations for better look.

about personal center viewcontroller

I want to achieve such effect,but I'm searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this.
You could put header view inside tableHeaderView like this:
self.tableView.tableHeaderView = headerView;
Background imageView put under tableView.
Last thing is top status bar background rectangle,
I recommend to use this library https://github.com/telly/TLYShyNavBar

How do i Create "Slide-Out Navigation Panel" with Non movable(Fixed) UINavigation Bar in iOS?

In one of my app i want to create Side left menu as many popular app provide.
I have already done it my projects using PPRevealSideViewController.
But the issue is it is not supported with Non movable UINavigation bar.
It only supported with Below UI.
Whereas Below is My requirement.
Requiremt is: Top UInavigationBar must be Non movable and fixed and another ViewController slide the FirstView Controller.
I tried to hack with the library But till now not able to reach to my requirement.
Does any of you have done similar thing? Or any suggestions?
Any Help will be appreciated.
Thanks & Regards,
Jenifer.
Find Demo of similar 3rd party Library named as CCKFNavDrawer.
You need to do some settings with this as below:
In CCKFNavDrawer.m class add below code once in viewDidLoad: method
self.shawdowView.backgroundColor = [UIColor clearColor];
and comment else where ,
set ContentInset as Below:
[self.drawerView.drawerTableView setContentInset:UIEdgeInsetsMake(0, 0, 0, 0)];
Change Below stuff:
self.outFrame = CGRectMake(-self.menuWidth,64,self.menuWidth,self.meunHeight);
self.inFrame = CGRectMake (0,64,self.menuWidth,self.meunHeight);
Tell me if you need more help regarding this.

UIButton modifying titlelabel seems to change its frame

Something strange is happening. Basically, I am trying to recreate the messaging app. So when I am trying to get the Send button to change from Grey to blue when the user has typed in at least 1 character.
The problem comes when I am trying to change titleLabel, the button will disappear. Later I found out it reverts back to the old position (when the keyboard it not shown).
Why does it do this? If I do not modify the titleLabel everything works as usual. However, if I do, the UIButton goes back to the original location. If you need any sample code let me know, but I am not sure what to put on here as it's just [self.button.titleLabel setTextColor: [UIColor blueColor]; in the UITextViewdidChange but it's acting strange.
Thanks!
Alan
You might be fighting against auto-layout. I saw similar behavior, and someone answered my question here: Why does UIButton resize when I access titleLabel property?. Basically, I was suggested to forego auto-layout completely or only use auto-layout (never set frames programmatically).
Well as mentioned here by others, you might be "fighting" with auto-layout. You do not have to ditch auto-layout, you could just bind the NSLayoutConstraint to an IBOutlet property, and update the constraint. If you do not have a constraint, then one is created automatically for you - you should create one manually and attach it. If it is created in code, the find it by code and save a reference to it.
You could also go back to the simpler AutoResizing, which was there before auto-layout (and is not deprecated, yet).

How I get the clear button more on the right side?

I add a UITextField to a UITableViewCell as a AccessoryView. I'd like a clear button at the end of the textfield. Now it looks like this:
http://twitpic.com/43mzwu
I think the clear button doesn't look good. I think it should be more on the right site. But now I found no solution to get the button more on the right side. Do you have any solution for my problem.
(Sorry for my bad english, I'm no native.)
Subclass UITextfield and implement clearButtonRectForBounds:. You can refer to the iOS Reference Library for more details on UITextFields.

Resources