I am trying to work with the Google Place Picker API
(https://developers.google.com/places/ios-api/placepicker)
I and want to edit a few things when the modal PlacePicker view appears.
For example the 'Title' should be either another language or set by me. Or generally edit navigation bar (left button etc).
I would also like to change the mapStyle ?
Related
Above mentioned solution is not working for my project in iOS , (this,"false") can you please help me to sort out the issue . Screenshot attached for your reference. How to hide back button in navigation bar xamarin forms
If you want to set the title of this page, set a SetBackButton on the page you want to return to.
You can add the following code to the page's constructor to hide the back button:
NavigationPage.SetHasBackButton(this, false);
Yesterday I asked the same question but I forgot to say that it was for Xamarin.Android, not for Android(JAVA) (sorry about that) and the solution I got was for Android(JAVA) but I can't implement it on Xamarin.Android. I didn't delete the question, I left it just in case someone in the future needs it for Android, but I want to know the solution for Xamarin.Android.
I have the following MainActivity:
When I click on "Congreso" button the following activity appears:
And when I click on "Programa" button the following activity appears:
All activities except MainActivity have an action bar with a back button, a title of the activity aligned at the same place each time and the same color of the action bar. In my case I want the color to be blue. My question is, is there a way to set that behaviour on a single place in the application and it to apply to all the activities except for the MainActivity so that if some day I want to change the color of the action bar or the alignement of its title I don't have to go to all activities one by one and change it.
P.S.: I don't know if what is on the screenshots is an action bar or it is a toolbar. If you give me a solution with a toolbar it is OK too.
I am trying to make a toggle box similar to the one you use in the Angular Material docs when you want to view the source code. You press the <> button on the menu bar and the panel slides open underneath revealing the html. For example, this page has one: https://material.angularjs.org/latest/demo/button
I can't seem to find it anywhere in the docs and I am not sure what the element is called or how to use it.
I am trying to add an image next to the hamburger menu in my app. I am using a master detail page and it renders fine in ios and android. I tried using setting the icons for the detail pages. but the icons never showed. How do I achive this. I am looking to add an image similar to the amazon app.
I checked out this app on my phone and it uses a lot of custom constructions that aren't supported by out of the box Xamarin Forms controls. Something like the back arrow next to the hamburger menu is not a standard thing (on iOS at least). Also looking at the actual menu that the hamburger button triggers it becomes clear that its not an out of the box hamburger menu. Theirs pops over the content instead of sliding it out of view as the built-in one does.
More than likely they implemented their own hamburger menu and navigation structure which gave them the freedom to add buttons next to it. If you want to achieve this with out of the box controls you will most likely need custom renderers for each platform to create a replica of this navigation structure.
What is built-in in Xamarin Forms is that you can set the page title to an image instead of text by using the NavigationPage.SetTitleIcon method, which could be used to achieve what you want:
public class MyPage : NavigationPage
{
public MyPage ()
{
var myContentPage = new MyContentPage (Color.White);
this.Push (myContentPage);
var s = "icon.png";
NavigationPage.SetTitleIcon (myContentPage, s);
}
}
Even then, this is limited in functionality. If you want to fiddle with the alignment of the image e.g. you would also need to resort to a custom renderer.
I have a navigation controller stack where one of the views has a dynamic title.
The view controllers and their titles go like this:
Main --> ItemsTableView --> ItemDetails
Title:Main Title: NN Items Title: Details
Because the iOS UINavigationController sets the text of the "Back" button to be the title of the previous screen, the "Back" button on the details screen says "< NN Items" where NN is a dynamically changing number.
I'm trying to do some iOS UI automation, but the accessibility Label / ID of the back button is set by the system to it's button text. This means that the accessibility label of the back button on the details screen will change dynamically, and I can't find it from my scripts!
If I could get a reference to the UIBarButtonItem then I could easily set it's accessibilityLabel or accessibilityIdentifier from code to be a fixed string, however I can't figure out how to do this?
All of the stuff I've been able to find references setting the back button to a custom button via self.navigationItem.backBarButtonItem or similar, but when I read this property it's nil. I haven't been able to find out how to get access to the standard item without replacing it. I'd prefer not to replace the button if possible
This was bugging me as well. I've been writing Xcode 7 UI Tests and was trying to come up with a generic way of tapping on the back button without having to replace it with a custom button.
The following is how I solved this for Xcode 7 UI Tests - but you may also be able to apply this to UI Automation as well.
I discovered that (in terms of Xcode 7 UI Tests at least) the back bar button item that is created by the system consists of two buttons the entire thing is a button with an accessibility label of whatever the title of the button is, and then the arrow is also a button with an accessibility label of "Back".
Thus, as long as there aren't any other buttons on the screen that are identified as "Back", the back button can be accessed via the accessibility label of "Back". Like so in the case of UI Tests:
[[app.buttons matchingIdentifier:#"Back"] elementBoundByIndex:0]
Here I'm getting the first button that can be identified by "Back". I my case there could only ever be two such buttons - the arrow, or the whole back button itself (in the case where the back button's title is also "Back"). Since both of these buttons are essentially the same, just getting the first one it finds is sufficient.