我正在使用react-bootstrap开发一个网站,我有一个容器,其宽度需要更改为60%,并且仍然居中。我更改了宽度,但找不到使容器居中的方法。我怎样才能做到这一点?
这是我的代码:
import {Row, Col, Container, Button} from "react-bootstrap"
import '../CSS/Room.css'
const Room = () => {
return (
<>
<Container fluid>
<Row className="roomfac fontReg">
<Col lg={3} className="text-center">
<img src="./Images/logofridge.png" alt="Logo 1"/>
<h3 className="fontSB">Fridge</h3>
</Col>
<Col lg={3} className="text-center">
<img src="./Images/logoAC.png" alt="Logo 2"/>
<h3 className="fontSB">AC</h3>
</Col>
<Col lg={3} className="text-center">
<img src="./Images/logowifi2.png" alt="Logo 3"/>
<h3 className="fontSB">Wifi</h3>
</Col>
<Col lg={3} className="text-center">
<img src="./Images/logotv.png" alt="Logo 4"/>
<h3 className="fontSB">TV</h3>
</Col>
</Row>
</Container>
</>
)
}
export default Room
Run Code Online (Sandbox Code Playgroud)
这是我的 CSS:
import {Row, Col, Container, Button} …Run Code Online (Sandbox Code Playgroud) 您好,我正在尝试创建一个颤振应用程序,即使应用程序关闭也能显示通知。
我设法找到了一些与flutter_background_service相关的插件,但是当我尝试复制示例中显示的代码时,它显示了一些与 AndroidServiceInstance 和 setAsBackgroundService() 相关的错误,说明它们未定义。如何解决这个问题?有没有更好的方法来实现我想要的?谢谢之前。
这是我当前的代码:
Future<void> initializeService() async {
final service = FlutterBackgroundService();
const AndroidNotificationChannel channel = AndroidNotificationChannel(
notificationChannelId, // ID
'MY FOREGROUND SERVICE', // Title
description:
'This channel is used for important notifications.', // Description
importance: Importance.low, // importance must be at low or higher level
);
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
if (Platform.isIOS) {
await flutterLocalNotificationsPlugin.initialize(
const InitializationSettings(
iOS: IOSInitializationSettings(),
),
);
}
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.createNotificationChannel(channel);
await service.configure(
androidConfiguration: AndroidConfiguration(
onStart: onStart,
autoStart: …Run Code Online (Sandbox Code Playgroud)