pub struct NativeTabBarView { /* private fields */ }Expand description
A real, bare UITabBar on iOS/iPadOS — a controlled bottom tab bar
that never navigates by itself: a tap reports the requested TabId
through Self::on_select, the app routes (typically
RouteNavigator::go) and feeds the confirmed id back as selected on the
next build. A tap on the tab already showing reports through
Self::on_reselect instead (“scroll to top / pop to root”). macOS and
Android (and every host target) render a frust-drawn refusal banner.
Build one with native_tab_bar.
§Placement and height
The bar sizes itself: 49pt tall plus the window’s bottom safe-area inset,
read at layout time, as wide as its parent allows — so its background runs
under the home indicator while UIKit keeps the items above it. Put it last
in a Column docked to the window’s bottom edge, and do not also
consume the bottom inset above it: if you wrap it in frust::safe_area
for horizontal cutouts, use .top(false).bottom(false) — the shape
examples/huddle uses for Material’s navigation_bar, which self-insets
the same way. For a bar that is not docked to the bottom edge, call
Self::safe_area(false) to get the bare 49pt.
On iPadOS a bare UITabBar stays a bottom bar (the iPadOS 18 top tab bar
and the Liquid Glass floating bar are UITabBarController features), which
is expected.
Implementations§
Source§impl NativeTabBarView
impl NativeTabBarView
Sourcepub fn on_select(self, handler: impl Fn(TabId) + Send + Sync + 'static) -> Self
pub fn on_select(self, handler: impl Fn(TabId) + Send + Sync + 'static) -> Self
Fires with the requested tab’s id when the user taps a tab other
than the one showing — the app confirms (or rejects) it by feeding
selected back through the next build. Never fires on a target with
no tab-bar arm.
Trait Implementations§
Source§impl Clone for NativeTabBarView
impl Clone for NativeTabBarView
Source§impl Component for NativeTabBarView
impl Component for NativeTabBarView
Source§impl<Outer: 'static> View<Outer> for NativeTabBarView
impl<Outer: 'static> View<Outer> for NativeTabBarView
Source§type Element = ComponentWidget<NativeTabBarView>
type Element = ComponentWidget<NativeTabBarView>
Source§fn build(&self, ctx: &mut BuildCtx<'_>) -> Self::Element
fn build(&self, ctx: &mut BuildCtx<'_>) -> Self::Element
Source§fn rebuild(
&self,
prev: &Self,
element: &mut Self::Element,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut Self::Element, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl !RefUnwindSafe for NativeTabBarView
impl !UnwindSafe for NativeTabBarView
impl Freeze for NativeTabBarView
impl Send for NativeTabBarView
impl Sync for NativeTabBarView
impl Unpin for NativeTabBarView
impl UnsafeUnpin for NativeTabBarView
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.