Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TDBottomTabBar] 在bottomNavigationBar中使用时,直接赋值,会撑满整个屏幕,并且也没做安全区域的限制 #1

Closed
BingKui opened this issue Dec 8, 2023 · 3 comments

Comments

@BingKui
Copy link

BingKui commented Dec 8, 2023

tdesign-flutter 版本

0.1.0

重现链接

No response

重现步骤

import 'package:flutter/material.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: false,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});

final String title;

@OverRide
State createState() => _MyHomePageState();
}

class _MyHomePageState extends State {
int _counter = 0;

void _incrementCounter() {
setState(() {
_counter++;
});
}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: const TDNavBar(
title: "TDesign Demo",
rightBarItems: [],
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
bottomNavigationBar: TDBottomTabBar(
TDBottomTabBarBasicType.iconText,
componentType: TDBottomTabBarComponentType.label,
outlineType: TDBottomTabBarOutlineType.capsule,
useVerticalDivider: false,
barHeight: 56,
navigationTabs: [
TDBottomTabBarTabConfig(
iconTextTypeConfig: IconTextTypeConfig(useDefaultIcon: true, tabText: '标签'),
tabText: '标签',
onTap: () {
// onTapTab(context, '标签1');
},
),
TDBottomTabBarTabConfig(
iconTextTypeConfig: IconTextTypeConfig(useDefaultIcon: true, tabText: '标签'),
tabText: '标签',
onTap: () {
// onTapTab(context, '标签2');
},
),
TDBottomTabBarTabConfig(
iconTextTypeConfig: IconTextTypeConfig(useDefaultIcon: true, tabText: '标签'),
tabText: '标签',
onTap: () {
// onTapTab(context, '标签3');
},
),
],
),
floatingActionButton: TDButton(
icon: TDIcons.add,
onTap: _incrementCounter,
shape: TDButtonShape.circle,
type: TDButtonType.fill,
size: TDButtonSize.large,
theme: TDButtonTheme.primary,
),
);
}
}

期望结果

期望按照实际高度显示,并且做底部安全区域的处理

实际结果

撑满整个页面,底部也没做安全区域的处理
image

Flutter版本

No response

设备与机型信息

iOS 15 pro

系统版本

iOS17

补充说明

No response

Copy link

github-actions bot commented Dec 8, 2023

👋 @BingKui,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@Luozf12345
Copy link
Collaborator

感谢反馈,目前确实存在这个问题,我们会在下个版本尽快解决

Luozf12345 pushed a commit that referenced this issue Dec 29, 2023
@Luozf12345
Copy link
Collaborator

0.1.2版本已修复

Luozf12345 pushed a commit that referenced this issue May 27, 2024
新增选中样式,以及自定义文本边距
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants