您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
45 行
1.6 KiB
45 行
1.6 KiB
using System.Collections.Generic;
|
|
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.material;
|
|
using Unity.UIWidgets.rendering;
|
|
using Unity.UIWidgets.ui;
|
|
using Unity.UIWidgets.widgets;
|
|
using UnityEngine;
|
|
using Color = Unity.UIWidgets.ui.Color;
|
|
|
|
namespace UIWidgetsSample {
|
|
|
|
public class BottomAppBarSample : UIWidgetsSamplePanel {
|
|
|
|
protected override Widget createWidget() {
|
|
return new MaterialApp(
|
|
showPerformanceOverlay: false,
|
|
home: new BottomAppBarWidget());
|
|
}
|
|
|
|
protected override void OnEnable() {
|
|
FontManager.instance.addFont(Resources.Load<Font>(path: "fonts/MaterialIcons-Regular"), "Material Icons");
|
|
base.OnEnable();
|
|
}
|
|
}
|
|
|
|
public class BottomAppBarWidget : StatelessWidget {
|
|
public BottomAppBarWidget(Key key = null) : base(key) {
|
|
|
|
}
|
|
|
|
public override Widget build(BuildContext context) {
|
|
return new Scaffold(
|
|
backgroundColor: Color.clear,
|
|
bottomNavigationBar: new BottomAppBar(
|
|
child: new Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: new List<Widget> {
|
|
new IconButton(icon: new Icon(Unity.UIWidgets.material.Icons.menu), onPressed: () => { }),
|
|
new IconButton(icon: new Icon(Unity.UIWidgets.material.Icons.account_balance),
|
|
onPressed: () => { })
|
|
})));
|
|
}
|
|
}
|
|
}
|