I put on bevel button in toolbar, set image for this button and uncheck checkbox bordered. How make pushed icon in toolbar like this?
You need to mark your toolbar item as Selectable. Edit your nib file in Xcode, double click the toolbar, click the item in Allowed Toolbar items and, in the Utilities panel, show the Attributes inspector and mark the Selectable checkbox.
Return your item identifiers in the delegate of the toolbar:
- (NSArray*)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{
return _toolbarIdentifiers;
}
The toolbar will consider them selectable, so the selected item will be displayed the way you need.
Related
I've created a custom dialog & a recyclerview, and when i click an item in the recycler view my custom dialog appears but it just appears in the same place. How can i control it place exactly down the clicked item?
I have created a nested list. When the text of the selected item is quite long than back button overlaps the toolbar title.
Is there any way to align toolbar text to right or set font size??
Any help is appreciated.
You can use only "Back" (or something else) for the back button. You just need to add this config in your nested list: useTitleAsBackText: false (It is true by default).
Else, you can reduce the font size for both button and toolbar title in your CSS file. Like this:
.my-nested-list .x-toolbar .x-button-label,
.my-nested-list .x-toolbar .x-title {
font-size: 13px;
}
My tabbar have more than 6 items,when I click [more] item,it will show other items with a tableview.
Then click the one of items,I hide the navBar use setNavigationBarHidden:YES in viewDidLoad,and I have a custom button click to back [more] use popViewControllerAnimated:YES.
When it back,the navBar still hiding,how can I show the navBar recover on [more] screen?(I need the EDIT button in [more])
Just call setNavigationBarHidden:NO animated:YES, before calling popViewControllerAnimated:YES.
I added this to viewdidAppear on my custom tabbar controller class
not the proper way to to do it but I haven't had any problems with it
tabBarController!.moreNavigationController.isNavigationBarHidden = true
tabBarController!.tabBar.isHidden = true
I want the disclosure button to be visible on each of the items of the list only when i click an "EDIT" button. How can i do that?? I tried "list.setOnItemDisclosure(true);" on clicking the EDIT button but disclosure didn't appear.
Just create a css class where the x-item-disclosure would be hidden :
.hidden-disclosure-list .x-list-disclosure {
display: none;
}
Then when you want to hide them you just have to do:
list.addCls('hidden-disclosure-list');
And when you want to display them just do:
list.removeCls('hidden-disclosure-list');
Hope this helps
Manipulate the list's on item disclosure property...On click of the edit button toggle the list's onItemDisclosure property...
list.setOnItemDisclosure(true);
I'm trying to write a Safari extension that consists of a button on the main toolbar with a popover tied to it, and a contextual menu item. The basic feel is modeled after the feel of the 1Password extension.
One of the jobs of the popover is to allow a person to log in. I'm also conditionally changing the action of the contextual menu item, and if a who person isn't logged in clicks the menu item I would like to show the popover allowing them to log in, but I can't find a way to do this in the developer guides.
How do I "show" a popover?
If you only have one toolbar item and one popover (and never plan to add more), then it's just one line. Assuming you've already assigned the popover to the toolbar item in Extension Builder, you can just use:
safari.extension.toolbarItems[0].showPopover();
But if you have more than one popover and (potentially) more than one toolbar item, here's a generalized function to open a popover, specified by its identifier, under the specified toolbar item in the active browser window:
function showPopover(popoverId, toolbarItemId) {
var toolbarItem = safari.extension.toolbarItems.filter(function (tbi) {
return tbi.identifier == toolbarItemId && tbi.browserWindow == safari.application.activeBrowserWindow;
})[0];
var popover = safari.extension.popovers.filter(function (po) {
return po.identifier == popoverId;
})[0];
toolbarItem.popover = popover;
toolbarItem.showPopover();
}