how to implement tab in the navigation title? - tabs

I want to add tabs in the navigation title like below. Anyone could tell me the method to implement this.
I use swift2 and IOS9.

You can set any kind of UIView object to your navigationItem as a titleView
self.navigationItem.titleView = segmentedControl;
here segmentedControl maybe UISegmentedControl object.

Related

Displaying Umbraco Grid in Mega Menu

I want to display Umbraco Grid in Mega Menu, and I cannot use #CurrentPage.GetGridHtml("") in this scenario.
I need to get it using node variable: myNode.GetProperty("menuGrid")
What is the best way to do that?
You can use various ways of getting content from the grid. They are all described here: https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/render-grid-in-template.
In my opinion, the best way would be to create custom grid view / renderer and just use it here with proper method for retrieving content e.g.
#CurrentPage.GetGridHtml(Html, "yourGridPropertyAlias", "customgridview")
#CurrentPage.GetGridHtml(Html, "yourGridPropertyAlias", "/views/othercustomgridview.cshtml")
Marcin's suggestions were helpful with finding a solution.
Just in case somebody is looking for something similar I had my INode which hasn't got access to GetGridHtml. After convertion to typed content I regained access to that property
foreach (var country in countryNode.ChildrenAsList)
{
var myNode = Umbraco.TypedContent(country.Id);
var property = myNode.GetGridHtml("menuGrid");
}

Add custom layout to ActionBar with Gravity Left?

The ActionBar shows a space on the left side of the custom view.
I want to set my custom view align left of Actionbar.
I'm trying to set
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
and any other method like setLogo(null),But it's not work.
My code is like
ABCMainView actionLayout = new ABCMainView(this); //my custom view
getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
getSupportActionBar().setCustomView(actionLayout);
My ActionBar is android-appcompat-v21.
How can i do this?
Try with this in your Toolbar xml config
android:contentInsetStart="0dp"
Base on Chris Banes' response https://stackoverflow.com/a/26495926/1568429

how to make UIViewController Title show up on titleView in UINavigationController?

I thought, and I may be wrong, without doing anything, the titleView of UINavigationController default to the title of the UIViewController.
Mine is not the case and I wonder why?
I set the title of the UIViewController in the story board to #"Nearby". I confirm that it's indeed the title in viewDidLoad
- (void)viewDidLoad
{
PO(self.title);
PO(self.navigationController.title);
Produce
self.title: Nearby
self.navigationController.title: (null)
I think I can programatically force my way and set the titleView to a UILabel with my title but I am not sure that would be the right way to do it.
I wonder why self.navigationController.title is not automatically set to self.title? If so when should it be set and where?
By the way, I added this line:
self.navigationController.title=self.title;
That doesn't help.
Update: Changing the NavigationItem Title Works. But that's awkward. Also how do I change that programatically?

How to change properties of elemnts\childs created with script on flash builder

Hi guys im creating/adding elemnts in my item renderer but from some reason you cant access their specific properties, you can only change the general properties. I created a LABEL component but when i do LabelName.font , nothing happens, its like flex doesnt recognize that this is a LABEL. Here is my code
var mylabel:Label = new Label()
mylabel.font
when i do "mylabel.someProperty" it only shows the general properties of any component, but how can i change other properties like font,color,size etc..
Thanks ahead [=
Fonts are defined as styles in Flex, not propeties, so you need to use the setStyle method to update it. (Not my favorite part about Flex.) For example:
myLabel.setStyle('fontFamily', newFont)
There is a difference between MXML and ActionScript in this. In MXML, styles of a component are shown as if they were properties, when they are really not. To set the fontFamily of your label in AS3 code, for example, you would use
myLabel.setStyle("fontFamily", "Arial")

JTabbedPane tab-alignment

I can't seem to find this.
What method (and constant) do I use to align the tabs in a JTabbedPane.
I Found how to switch between Top and Bottom. But I'm trying to put them in the center at the bottom.
So that it looks like this
ooooooooooooooooooo
o..................................o
o..................................o
o..................................o
o..................................o
ooooooooooooooooooo
...... |Tab1||Tab2|
Thanks
You can't. This layout rule is enforced by the selected look and feel.
You can write your own UI-Delegate for JTabbedPane component that extends BasicTabbedPane class and overwrite the
method 'getTabInsets(int, int)'. Change value of 'tabInsets' atribute ( default value is: new Insets(0,4,1,4), centered).