navigation

FragmentContainerView as NavHostFragment

好久不见. 提交于 2020-04-12 07:50:12
问题 Seems like using the FragmentContainerView doesn't work right out of the box? <androidx.fragment.app.FragmentContainerView class="androidx.navigation.fragment.NavHostFragment" android:id="@+id/fragment_nav_host" android:layout_width="match_parent" android:layout_height="match_parent" app:defaultNavHost="true" app:navGraph="@navigation/nav_app" /> Here's my code using fragment-ktx:1.2.0-rc01 and I'm just always getting this error: Caused by: java.lang.IllegalStateException: Activity ..

Use 'navigation' and 'route' inside header present in class - React-navigation v5

你。 提交于 2020-04-10 05:31:43
问题 I'm stuck as I want to switch to the V5 version of react-navigation. With v4, I used to pass my params and use them with : Set : this.props.navigation.navigate('MyDestination', {myParam: 'value'}) Get : this.props.navigation.getParam('myParam') With v5, some things changed and I now can't use the this.props.navigation since it's not seemed to be known by the app. My code is splitted so I have my App.js that only refer to the Navigation class : import React from 'react'; import { StyleSheet,

onNavigationItemSelected not calling when item is selected

坚强是说给别人听的谎言 提交于 2020-04-07 10:48:07
问题 I am adding footer-view in navigation drawer using following code - <?xml version="1.0" encoding="utf-8"?> <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:openDrawer="start"> <include layout="@layout

Perform page navigation after a file download

爱⌒轻易说出口 提交于 2020-04-05 15:29:06
问题 I need to find a way to perform a page navigation after generating a file download. So far, I've got the file download ready and working: FileInputStream stream = new FileInputStream(file); FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); ec.responseReset(); ec.setResponseContentType("application/octet-stream"); ec.setResponseHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); OutputStream out = ec

Bottom app bar problem with placing icons

寵の児 提交于 2020-03-01 04:09:02
问题 I have a problem with bottom app bar, because I want the icons to be displayed to me in the first picture Instead I got this: 回答1: You can place a custom layout inside your BottomAppBar . The only thing is that you will need to align items in your custom layout manually. <com.google.android.material.bottomappbar.BottomAppBar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" style="@style/Widget.MaterialComponents.BottomAppBar"

Bottom app bar problem with placing icons

安稳与你 提交于 2020-03-01 04:06:59
问题 I have a problem with bottom app bar, because I want the icons to be displayed to me in the first picture Instead I got this: 回答1: You can place a custom layout inside your BottomAppBar . The only thing is that you will need to align items in your custom layout manually. <com.google.android.material.bottomappbar.BottomAppBar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" style="@style/Widget.MaterialComponents.BottomAppBar"

Swift 3: How to reverse a transparent Navigation Bar?

瘦欲@ 提交于 2020-02-24 09:25:08
问题 I'm trying to create a twitter app, emulating the real app, using the twitter API. On the timeline view, I have a regular navigation bar, and when a user taps a user profile, the profile view has a transparent bar so that the user's banner image can be displayed. I used the following code to make the navigation bar transparent in the user profile view: self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController?.navigationBar.shadowImage =

Flutter: best practices for persisting same widget while navigating to different screens/routes

核能气质少年 提交于 2020-02-23 07:37:00
问题 For the app we are making, it is required that a widget should remain active and visible while the user navigates to different screens; specifically, we need a music player widget that keeps playing music (while showing its live controls) while the user navigates to different routes, as shown in the diagram below (in the link). Flutter widget persisting during navigation Searching around, we found some hints on how to tackle this very basic use case (some suggest using the Material App's

SwiftUI: Dismiss View Within macOS NavigationView

孤街醉人 提交于 2020-02-22 07:41:47
问题 As detailed here (on an iOS topic), the following code can be used to make a SwiftUI View dismiss itself: @Environment(\.presentationMode) var presentationMode // ... presentationMode.wrappedValue.dismiss() However, this approach doesn't work for a native (not Catalyst) macOS NavigationView setup (such as the below), where the selected view is displayed alongside the List . Ideally, when any of these sub-views use the above, the list would go back to having nothing selected (like when it

SwiftUI: Dismiss View Within macOS NavigationView

别等时光非礼了梦想. 提交于 2020-02-22 07:41:07
问题 As detailed here (on an iOS topic), the following code can be used to make a SwiftUI View dismiss itself: @Environment(\.presentationMode) var presentationMode // ... presentationMode.wrappedValue.dismiss() However, this approach doesn't work for a native (not Catalyst) macOS NavigationView setup (such as the below), where the selected view is displayed alongside the List . Ideally, when any of these sub-views use the above, the list would go back to having nothing selected (like when it