小编jam*_*mal的帖子

在不重新启动应用程序的情况下反应本机应用程序从 LTR 到 RTL 的更改

目前我正在使用I18nManager更改LTR to RTL,但它只有在重新启动应用程序后才能工作,我的代码如下

 import {I18nManager} from 'react-native';
 import RNRestart from 'react-native-restart';

changeLtrToRtl=()=>{
    I18nManager.forceRTL(true);
    RNRestart.Restart();
}
Run Code Online (Sandbox Code Playgroud)

是否有其他方法可以在不重新启动应用程序的情况下实现从 LTR 到 RTL 的更改?

android ios reactjs react-native

6
推荐指数
1
解决办法
4744
查看次数

如何提高使用多个 Include 的 EF Core 查询的性能

我有这个查询,为了简洁起见,我将简化它:

public IQueryable<User> GetByIdAsync(Guid userId)
{
    return MyContext
        .Users
        //Bunch of Includes
            //Most of which have a ThenInclude
                //Followed by another ThenInclude
        .FirstOrDefaultAsync(u => u.Id == userId)
}
Run Code Online (Sandbox Code Playgroud)

当为大约 100 个用户运行时,需要超过 15 秒(在我的计算机上本地运行)。不是很好。

我尝试过使用AsNoTracking(),以及将其更改为使用已编译的查询,如下所示:

private static Func<MyContext, Guid, Task<User>> _getByIdAsync =
            EF.CompileAsyncQuery((MyContext context, Guid userId) =>
                context
                .Users
                //Same Includes as above
                .Where(u => u.Id == userId)
                .FirstOrDefault());

public IQueryable<User> GetByIdAsync(Guid userId)
{
    return await _getByIdAsync(userId);
}
Run Code Online (Sandbox Code Playgroud)

还是没有区别。

我查看了相关线程的答案,它建议使用普通的旧 SQL:

/sf/answers/1188405291/

我查看了这个答案,其中提到了聚集索引:

/sf/answers/3889006621/

我当然不能排除其中任何一个,Includes因为客户依赖于所有这些信息。在这个阶段,重新设计也不是一个选择。

问题

  1. 还有其他可以提高性能的选项吗? …

performance database-performance psql entity-framework-core

5
推荐指数
1
解决办法
2113
查看次数

如何更改 react-native webview 的 font-family (font-family.ttf from assets)

我正在使用react-native webview在我的react-native应用程序中显示一些网络内容 。和我的应用程序font-familywebview font-family是不同的。我想webview font-family从应用程序更改。

是否有变化的任何方法font-familywebview(自定义字体从资产目录),请帮我..谢谢

android ios reactjs react-native react-native-webview

5
推荐指数
1
解决办法
467
查看次数

如何将 base64 转换为 pdf React-Native

我使用API创建了一个应用程序react-native并拥有一些Base64数据。我想将base64数据转换为pdf格式。如果你有任何想法请帮助我。谢谢。

base64 android ios reactjs react-native

3
推荐指数
1
解决办法
2万
查看次数

React-Native 服务器驱动的 ui

我总是想知道 Airbnb、Flipkart 和 Swiggy 等应用程序如何动态更新其 UI。即使我没有更新应用程序,Flipkart 在节日期间也会显示不同的 UI,而 Swiggy 总是根据设备位置更改其 UI。

\n

我如何在我的react-native-app 中实现这个?

\n

Webview 是解决方案吗?

\n

请帮助我..\n谢谢

\n

android ios reactjs react-native

2
推荐指数
1
解决办法
3331
查看次数