I need to show error message as a tooltip in iOS 8 but i don't know how to do it. What I want is something similar to the one shown in below image (I'm referring to the tooltip with messages Select and Select All):
There is a great collection of libraries which already target your problem.
For example have a look at: AMPopTip.
Then you could show the popover like:
self.popTip = [AMPopTip popTip];
[self.popTip showText:errorMessage direction:AMPopTipDirectionUp maxWidth:200 inView:self.view fromFrame:textField.frame];
and hide it:
[self.popTip hide];
Have a look at the github repo there are more examples for customizing this control.
You can find more which might suit your needs better here: cocoacontrols.com
I had a similar problem and wrote my own custom tooltip.
You can init with your custom view (i assume you write some delegations to detect actions within.) and present from anywhere.
Maybe not the best replacement of UIPopoverController but still works great. And a lifesaver for iPhone. Also highly customisable.
https://github.com/akeara/AKETooltip
Hope this helps.
Related
So I have a few buttons in my app that i want to show tool tips above. I am using the module EasyTipView but it shows the tool tip below my button, I want the tool tip above my buttons. Can anyone please help, I am super new to iOS and I know it's an easy task but I am unable to find a solution.
https://github.com/teodorpatras/EasyTipView
I think I found EasyTipView. It looks like it is on github at https://github.com/teodorpatras/EasyTipView. Is that it?
If so, that class has a property arrowPosition. The "Usage" section of the readme says:
Usage
First you should customize the preferences:
var preferences = EasyTipView.Preferences()
// deleted other preferences settings that aren't relevant
preferences.drawing.arrowPosition = EasyTipView.ArrowPosition.top
Further down in readme, it lists the legal arrow positions as .top, .bottom,.left,.right, and .any.
If you want your tool tip to appear below the view, you should try usingEasyTipView.ArrowPosition.top.
I am going through a iOS Programming tutorial using Xcode 8.1. Everything is going well until I needed to add a valueChanged event to the uisegmentcontrol element. When I drag it to bind to the function it does not work. Here is the gif I made that could explain better. Any help is greatly appreciated. thanks
Edit: Here is another gif of the actual tutorial that shows how the event is bound to the function. The full video can be found here actual tutorial. Thank you
I think you not set the class name of the scene.
E.g.
Name of Class for the Scene: ViewController.m
set StoryboardID if you need.
Thank you all. I just figure out that Xcode now add the parameter Any to all the functions generated. So to be able to bind the event to the function, I needed to change the parameter to AnyObject. I hope it helps someone else in the same situation. :)
I just started my first project in iOS, recently I have encountered a problem in the UI when i receive it from the designer.
The expected output is shown as below and i can do most of it without any problem.
Now the problem came when I am about to implement this :
As the number of colour varies depending on item, I cannot add it like what I did for the share and love button I have no idea how can i implement something like this, I have look through the Object Library in the storyboard and cannot find any that can produce the output as expected .Any helps and guides are much apprecited!
I want to jump to third tab in tabcontroller. I searched in Google but found nothing helpful.
If anybody can help I will be grateful.
Was the title/question changed? I thought the question was about Xcode...
For what you're asking, try setting selectedIndex of your UITabBarController, like this:
self.tabBarController.selectedIndex = indexOfTab;
However don't overuse it, some automatic transitions between tabs can be considered as bad user experience.
Don't just stop with this shortcut - learn more! Here's an extensive list of Xcode 4 shortcuts: print the B&W version, pin it your wall, learn and enjoy the Xcode even more.
You want to set the selectedIndex property of the tab controller
http://developer.apple.com/library/ios/documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html
I'm currently playing with a bar chart implemented through Open Flash Charts (I believe version 1, might be version 2...) with PHP. Unfortunately, we're having real trouble with the tooltip not showing the correct thing. I am trying to get it to show the x-axis label for the hovered-over column, then a ":", then the value of the bar. The code is as follows:
$Colour = '#3465A4';
$BarChart= new bar();
$BarChart->set_values($Bar);
$BarChart->set_colour($Colour);
$BarChart->set_tooltip('#x_label#:#val#');
$x_labels = new x_axis_labels();
$x_labels->set_labels($Roles);
$x_labels->rotate(-60);
$x = new x_axis();
$x->set_labels($x_labels);
$chart = new open_flash_chart();
$chart->add_element($BarChart);
$chart->set_bg_colour( '#FFFFFF' );
$chart->set_x_axis($x);
$tooltip = new tooltip();
$tooltip->set_hover();
$chart->set_tooltip($tooltip);
$JSONArray['my_chart_1'] = $chart->toPrettyString();
As far as I can tell, this should be correct - the bar chart appears, with the correct values (populated from $bar, whose generation is not shown above). However, the hover-over tool-tip for a column only shows ":value" - the label name is missing!
Does anyone know where we might have gone wrong, and how I can fix it?
EDIT:
An update for any Bounty Hunters coming in to try and answer this question. The reason I have not accepted the below answer is that it only provides a work-around, and does not explain why the work-around is necessary. I am looking either for an answer to my original question (how to make the labels show in a normal bar-chart), or a reasonable explanation regarding why one must use a stacked bar chart (including sources makes your answer so much better!). If the latter, example code or an explanation of how stacked charts are created would be much appreciated as well!
If you are happy with the simple bar visuals then use stacked bar (using it with an array of one element will draw it just like the simple bar). That one will replace #x_label# correctly.
Alternatively you can copy the missing code from Bars/Stack.as to other bar types and recompile the code.
As per: http://forums.openflashchart.com/viewtopic.php?p=7433#p7433
It's a bug in OFC2 in the latest versions (at least). I've found what is causing the issue with #x_label#, but my understanding of the code/Flash isn't good enough to know why it's happened/broken.
I've done a quick fix that I need to test some more, but it now works on bar charts. Assuming I've not broken anything else beyond repair, it'll make it's way into the next community release.
If anyone wants the source code changes before the next release let me know.
(I am currently maintaining the community releases)