gpt4 book ai didi

android - 根据locale设置第三方activity的screenOrientation

转载 作者:行者123 更新时间:2023-11-30 01:37:50 25 4
gpt4 key购买 nike

我在我的 Android 应用程序中使用 ZopimChat SDK。他们的聊天库包含一个 ZopimChatActivity,我从我自己的应用程序中启动它。

由于库中的本地化问题,当语言环境为阿拉伯语且设备为垂直方向时,聊天气泡不会出现;它们仅在设备水平放置时出现。 Zopim 对此没有修复,所以我想在设备为阿拉伯语时横向启动 Activity 。

有没有办法做到这一点?

最佳答案

免责声明:在 RTL 得到 Zopim Chat SDK 的完全支持之前,这只是一种解决方法。

通过在 Zopim 的 SDK 布局文件中指定 android:layoutDirection 来强制执行 LTR 布局。这将修复损坏的布局,但仍允许阿拉伯语。

通过在布局下创建一个 zopim_chat_activity.xml 并将以下内容复制到其中:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/root_container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layoutDirection="ltr">

<include
android:id="@+id/toolbar"
layout="@layout/zopim_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>

<FrameLayout
android:id="@+id/chat_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"/>

</RelativeLayout>

有关 Android Layout Docs 的更多详细信息和 Zopim's Developer Guide

Arabic with LTR

关于android - 根据locale设置第三方activity的screenOrientation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34900215/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com