I am trying to fit a map within a navbar and a footer, but all research i did seems to have no answers
I would like to know a way to fit a map like in https://www.bing.com/maps/?cp=11.177383%7E-3.142935&lvl=3.1
Related
UPDATE: I am adding a photo that may better demonstrate the type of thing I am trying to achieve.
I am creating an app where a user can set as many filters they like on a stream of images. I would like to display each filter they have set as a button with an X in it if they would like to remove it. I have created my own buttons and assigned actions to them, but this would be my first dynamic button project.
My confusion how to programmatically create the button, assign it an action that knows which filter to act on, and then arrange it so that the buttons behave like text in a text box such that if a button can't fit on the screen it "word wraps" to the next line.
I have a an array of the filters they have applied that I can loop through, I just don't know what the mechanism is for arranging them so that each button acts like its own word in a sentence. As a work around I could use a table/collection view but since the width of the filters varies amongst the potential buttons I was really hoping to not force a uniform width as those would require. I have seen apps that do this so I am hoping the experts on here can help.
I suspect the solution looks something like:
For loop that has for each filter in Filters
Create and configure a UIButton with the text title of the filter
Assign an action that takes an argument so I know which filter to remove
Assign constraints appropriately so it fills the width of the screen but "word wraps" once it can't fit and whatever container object it is in increases in height which would need to adjust in landscape mode
// Can a #selector take an argument like the filter's array location?
myButton.addTarget(self,action: #selector(helloButton), forControlEvents: .TouchUpInside )
The data labels in stacked bar chart in Qlik Sense does not work properly.
When we turned it ON, instead of displaying labels for individual stack it only displays one data label at the top.
Please can any one suggest if it is possible to display labels for all the items in the Stacked bar?
It is not possible to do this. You can only display the total. This is due to readability issues.
So I'm working on an app but I'm pretty new to Xcode and swift itself, so thats what i have right now [textview color is just to show you its size]
http://i.imgur.com/55fC4Fb.png
But this is what I want:
http://i.imgur.com/VA1hZqO.png
i thought using top and bottom layout guides would help, but I'm totally lost. If anyone could help that'd be amazing! :)
I'm sorry, but i am new to this :/
One simple way to do this is to drag the text view between nav bar and tool bar, and then pin its top and bottom edges to nearest neighbors (in this case, nav bar and tool bar), like this:
http://i.imgur.com/7CADxPh.png
NOTE: make sure its edges are in between bars, not overlapping them. Also uncheck the Constrain to margins -box.
I got it to look like this very quickly:
http://i.imgur.com/AfksPdQ.png
There are many other ways to do this, and this is just one of them. Search for storyboards tutorials and you'll find many good tutorials how to use Interface Builder. :)
I am using the gwt visualization API. I use the Table widget and would like to specify the height using the setHeight() method.
When I put enough records, the vertical scroll bar shown up. The width of the table no longer fit the data after the scroll bar show up. The column labels are long records are forced to split to two lines:
How can I avoid it ?
(I don't want to fix the width of the table as the data is dynamic and I will add arbitrary columns also).
Ok, I'm not particularly familiar with the "gwt visualization API" but the the first solution which comes to mind, is that you always show the scroll bars and make the field a little bit bigger.
Her a little code example:
ScrollPanel sp = new ScrollPanel();
sp.setAlwaysShowScrollBars(true);
or if you are using UiBinder:
<g:ScrollPanel ui:field="scrollPanel" alwaysShowScrollBars="true">
You can also let a scroll panel appear in the bottom so your lines still appear in the bottom, but I don't thin that's what you want...
Regards,
Stefan
Folks,
coming from the Java/Swing world, I am sometimes puzzled by the UI programming on the iPhone. I've spent the last hours with Googling for information but it seems that I asked the wrong questions by thinking too much in Java. Could you please point me to resources to get more familiar with the GUI concepts to be able to achive the following functionality:
Basically, I want to create a vertically scrollable view that represents structured text (for example, a recipe). Each step consists of a title and a textual description. As I want to fold and unfold such steps, the title would be somehow interactive and by clicking it the description would be displayed or hidden.
In Java, I would create a component that renders one such section. The layout manager would compute the components preferred height (with or without description being displayed).
Then, in Java, I would create a panel with a vertical layout manager and sequentially add my components. This panel would be placed in a scroll pane; the scroll pane would ask the panel to layout itself and then show a viewport on it, if for example the height is bigger than the scroll pane's height.
What Java provides me is:
layouting of elements (computing their preferred height and width), thus no need to deal with coordinates and dimensions
dynamic creation of UIs by creating and adding components during runtime
What I understood on the iPhone:
I can dynamically add views as subview to a view, e.g. a scrollview by calling addSubview
I can even remove that stuff using removeFromSubview (as explained here Clear content of UIScrollView)
What I don't understand on the iPhone:
does one view always correspond to a visible screen (I did use tab and navbar navigation so far and there whenever I set a new view, it fills the current visible screen minus the space needed for the two bars)?
or is it possible to define a view that contains a label on top ("north") and a text in center; if so, could such a view automatically determine its height?
can I realize my example in a similar way like in Java or would I need to calculate all dimensions and coordinates of the individual components on my own? (This example seems to touch on that topic: iPhone scrollView add elements dynamically with id)
Alternatively, could I use a WebView and render my stuff as local HTML using JavaScript to show or hide nodes?
Thanks for any hint or link!
There are no layout managers in Cocoa, views are being reposition according to their struts and springs settings. For information on that read the documentation: http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout.html
To create a "view that contains a label on top and a text in center" you create a view with subviews - one being a label at the top, second the textview in center. If you configure struts/springs for all of subviews properly, they will autoresize when the container view is resized.
You should also get accustomed to Interface Builder, creating views in code is real pain in the ass.