我从本地文件和节点模块导入 CSS 文件:
//> Global Styling
// Local
import "../styles/globals.scss";
// Icons
import "@fortawesome/fontawesome-free/css/all.min.css";
// Bootstrap
import "bootstrap-css-only/css/bootstrap.min.css";
// Material Design for Bootstrap
import "mdbreact/dist/css/mdb.css";
Run Code Online (Sandbox Code Playgroud)
这在我的本地开发版本上按预期工作。所有样式都显示为它们应有的样子。
正如您在此处看到的,本地和生产的样式不同。(看看字体和按钮)
我的next.config.js是:
//#region > Imports
const withSass = require("@zeit/next-sass");
const withCSS = require("@zeit/next-css");
const withFonts = require("next-fonts");
const withImages = require("next-images");
const withPlugins = require("next-compose-plugins");
//#endregion
//#region > Exports
module.exports = [
withSass({
webpack(config, options) {
config.module.rules.push({
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: {
loader: "url-loader",
options: {
limit: 100000,
},
},
});
return …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试在react-navigaionmaterial-top-tabs(也水平滚动)的内容中定位水平ScrollView 。
在水平 ScrollView 内拖动时,只有 ScrollView 会受到影响并滚动。
有时,当在水平 ScrollView 中拖动时,整个顶部选项卡会滚动。(选项卡正在切换)这对于用户体验来说是一场噩梦。
您知道有什么方法可以让它按预期方式工作吗?
代码片段:
导航.js
// Importing Top Tabs creator
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
...
// Creating the Tab Navigator
const Tab = createMaterialTopTabNavigator();
...
// Configure Navigator
<Tab.Navigator
initialRouteName="Tab 1"
screenOptions={{
headerShadowVisible: false,
headerStyle: {
backgroundColor: colors.background,
},
}}
// Using custom TabBar component
tabBar={(props) => <TabBar {...props} />}
>
// The horizontal ScrollView is in "Tab 1"
<Tab.Screen
name="Tab …Run Code Online (Sandbox Code Playgroud) android reactjs react-native react-navigation react-native-tabnavigator
我目前正在尝试将多个来源的视频实现到使用 Expo 和 ReactNative 构建的学习应用程序中。
我想包含以下视频源:
我尝试在以下配置中使用WebView:
<WebView
ref={videoRef}
onContentProcessDidTerminate={() => videoRef?.current?.reload()}
javaScriptEnabled={true}
sharedCookiesEnabled={true}
scrollEnabled={false}
allowsFullscreenVideo={true}
//allowsInlineMediaPlayback={true}
renderLoading={() => <ActivityIndicator />}
renderError={() => <Text>An error occurred.</Text>}
userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
source={{
uri: src,
}}
mediaPlaybackRequiresUserAction={true}
/>
Run Code Online (Sandbox Code Playgroud)
Android 和 iOS上的体验必须是无缝的,同时允许设备轮换。当用户以纵向模式启动视频并旋转设备时,我需要视频像 YouTube 应用程序一样继续无缝播放。
目前,我面临的问题是,我的解决方案在旋转屏幕时不起作用。视频停止,播放器关闭,视频暂停。然后方向锁定回纵向模式(这是应用程序所需的旋转)。我也尝试过,ScreenOrientation.unlockAsync()但我仍然面临同样的问题。使用<Video />from同样的事情expo-av。
回顾一下,一些核心要求是:
一个人如何去完成这样的事情呢?
javascript ×2
react-native ×2
reactjs ×2
android ×1
expo ×1
expo-av ×1
next.js ×1
video ×1
webpack ×1