Xamarin Forms Shell Bottom Tab Bar Selected Image - xamarin.forms

I'm using Xamarin Forms Shell TabBar and i'm working into renderers to customize this tabbar, i want to change icon when a tab is selected.
I found this tutorial : https://montemagno.com/tintcolor-selectedimage-xamarin-forms-ios/
I'm trying to achieve the "Selected TabItem Image" part where i have for each tab an icon for selected state and an icon for unselected state.
My issue is this tutorial using classic TabbedPage renderer where i am using a IShellTabBarAppearanceTracker (because i am using shell) and i can't access the tabs.Children[i].Icon property, only the controller.TabBar in public void SetAppearance(UITabBarController controller, ShellAppearance appearance) method.
So i have no way to access current tab icon's name to perform the following code :
icon = icon.Replace(".png", "_selected.png");
if(item?.SelectedImage?.AccessibilityIdentifier == icon)
return;
item.SelectedImage = UIImage.FromBundle(icon);
item.SelectedImage.AccessibilityIdentifier = icon;
is there a way to do it ? Or do we have to do it differently ?

Related

BackButton Focus on title bar UWP

I Have built a UWP application with a back button in the title bar.I want to access the back button in title bar using TAB key. Like we could able to access other button control which are inside the application, Seems these button of outside of application control.
If we need to make the focus on to to back button using TAB key then we need to customize the tile bar. They are various links available for reference learn.microsoft.com/en-us/windows/uwp/design/shell/title-bar

Xamarin Forms - iOS - Back button title

Is it possible to change the back button text in the NavigationPage after the constructor of the page ?
I have a list of buttons inside a page which are used to change the current language and want to update the back button’s title according to the selected language.
Thanks !
I think you're looking for something like this : https://forums.xamarin.com/discussion/comment/272076/#Comment_272076
Bind the Title's page property to a string and update the string depending on your selected language.

Storyboard UINavigation Controller Back Button Text

In XCode 4.5.1 creating a storyboard app with a Navigation controller, I am having a hard time trying to set the BACK button for any view controllers that are pushed. I'm using segue's and the view controller shows as expected. However I want to change the name of the navigation bar and back button dynamically and placed this in my ViewWillAppear:
self.title = #"Select Songs";
[self.backButton setTitle:#"Add"];
changes the title of the navigation bar but the back button still displays the NAME of the pushed window rather than the text "Add".
The Simulated Metrics are all Inferred. I also added a BarButtonItem to the black tray below the view in Xcode and wired up the backButton of the viewcontroller to the backButton, yet the text still does not appear.
Adding the following log messages also yield something interesting: (and yet the titlebar is updating correctly)
-(void) viewDidAppear:(BOOL)animated {
NSLog(#"%s %#", __FUNCTION__, self.navigationItem.backBarButtonItem);
NSLog(#"%s %#", __FUNCTION__, self.navigationController.navigationItem.backBarButtonItem);
}
2012-10-14 15:18:41.835 xxxx[2690:907] -[ViewController viewDidAppear:] (null)
2012-10-14 15:18:41.838 xxxx[2690:907] -[ViewController viewDidAppear:] (null)
The accepted answer is a hack, this is the way to do it...
Open StoryBoard
In Document Outline window find ViewController to which you want to
return to
Click on Navigation Item of that ViewController
In Attributes explorer change Back Button value to your custom tile
That is it, enjoy...
The back button will show the title of the previous view and if no title is set it'll show 'Back'.
So in your prepareForSegue method, you can change the title of the current view before the next view is pushed. The back button will then show whatever you set the title to.

UINavigationController custom titleView

I have a navigation controller with a root view controller for which i have the customised titleView instead of normal title for the navigation item.
If i pushed a new controller in it , the default back button title is "back", Since i have used custome titleView.
I want it to be different. I tried by setting the title in backbaritem of the root view controller, but no use.
I can create a bar button item in my pushed controller and i can set it as leftbar item, But i want it like a normal back button. [Pointing towards backward]
Is it possible to set title for the back button , if i have a custom titleView ?
Is it possible to create a bar button item as like as default back button.[Pointing towards back , other than plain,border...etc] ?
Regards,
Balaji R.
I got it.
Even though i have custom titleView for my navigation item, I can still set the title for the same navigation item where it wont be taken for the title display in navigation item . but it will taken as the title of the back button when some other controllers are pushed into it.
So , Now i'm having both title [Used for back title display] and titleView [custom view] in the navigation item.
Thanks,
Balaji R.

Setting the Panel Owner

I've got an application that allows a panel to popup to allow the user to edit some properties.
How do I set the panel owner so that it is on top of all the other components on the page without actually disabling them like you do with an alert box?
Use the PopUpManager to display something on top of everything else. I used a function like this to create the Popup before:
protected function createPopUp(className:Class):void{
var win : IFlexDisplayObject = PopUpManager.createPopUp(Application.application as DisplayObject, className, false) as IFlexDisplayObject;
PopUpManager.centerPopUp(win);
}
You can see it in action with the Flextras Calendar API Explorer. Click any button on the top bar.

Resources