随着 Flutter 2.0 的发布,FlatButton已被替换为TextButton.
因此,填充属性不再直接可用,而是作为ButtonStyle属性可用。
我的问题是,由于它不再可用,我该如何设置它EdgeInsets?
TextButton(
style: new ButtonStyle(
padding: ???,
),
//padding: const EdgeInsets.all(0), //NOT AVAILABLE
child: Text("Support", style: Theme.of(context).textTheme.headline2),
onPressed: () => {Navigator.pushNamed(context, SupportScreen().routeName)},
),
Run Code Online (Sandbox Code Playgroud) 我正在开发一个使用侧抽屉的 RN 应用程序。(RN 版本:0.59.8)
const DrawerNavigator = createDrawerNavigator(
{
Home: {
screen: HomeScreen
},
Poems: {
screen: PoemsScreen
},
Contest: {
screen: ContestScreen
},
AboutMe: {
screen: AboutMeScreen
}
},
DrawerConfig
);
export default createAppContainer(DrawerNavigator);
Run Code Online (Sandbox Code Playgroud)
使用的 react-navigation 版本是 3.11.0。在菜单中,多个子项指向同一个页面,即 ViewPager,但具有不同的参数(页面索引)。问题是以下方法都不起作用:
_this2.props.navigation.push is not a function)const resetAction = StackActions.reset({
index: 0,
key: 'Poems',
actions: [NavigationActions.navigate({ routeName: 'Poems' })]
})
this.props.navigation.dispatch(resetAction)
Run Code Online (Sandbox Code Playgroud)
(也试过key: null)
任何帮助深表感谢!
react-native react-native-android react-navigation react-navigation-drawer