当隐藏选项卡时,如何在屏幕底部有反应有天赋的聊天渲染消息框

时间:2017-05-22 12:09:59

标签: react-native react-navigation

所以我正在使用反应原生天赋的聊天以及反应导航。我的问题是我将标签栏显示为false,但天才聊天的输入框呈现在它认为的标签栏之上 - 这是隐藏的。

如何使其全屏渲染,或使其不浮动在隐藏的标签栏上方。

            string Info = "";
            string startPath = @"D:\dosfiles\ValPoch\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD";
            string zipPath = @"D:\dosfiles\ValPoch\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip";

            if (File.Exists(zipPath))
            {
                File.Delete(zipPath);
                ZipFile.CreateFromDirectory(startPath, zipPath);
                //MessageBox.Show("Вашият архив е създаден в папка D:\\dosfiles\\ValPoch\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip");
                Info += "Вашият архив е създаден в папка D:\\dosfiles\\ValPoch\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip" + Environment.NewLine;
            }
            else
            {
                ZipFile.CreateFromDirectory(startPath, zipPath);
                //MessageBox.Show("Вашият архив е създаден в папка D:\\dosfiles\\ValPoch\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip");
                Info += "Вашият архив е създаден в папка D:\\dosfiles\\ValPoch\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip" + Environment.NewLine;
            }

            string startPath1 = @"D:\dosfiles\SVK\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD";
            string zipPath1 = @"D:\dosfiles\SVK\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip";

            if (File.Exists(zipPath1))
            {
                File.Delete(zipPath1);
                ZipFile.CreateFromDirectory(startPath1, zipPath1);
                //MessageBox.Show("Вашият архив е създаден в папка D:\\dosfiles\\SVK\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip");
                Info += "Вашият архив е създаден в папка D:\\dosfiles\\SVK\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip";
            }
            else
            {
                ZipFile.CreateFromDirectory(startPath1, zipPath1);
                //MessageBox.Show("Вашият архив е създаден в папка D:\\dosfiles\\SVK\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip");
                Info += "Вашият архив е създаден в папка D:\\dosfiles\\SVK\\" + comboBox1.SelectedItem.ToString() + "_" + comboBox2.SelectedItem.ToString() + ".SVD.zip";
            }
            if (Info != "")
            {
                MessageBox.Show(Info);
            }

enter image description here

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,这就是我所做的:

react-native-gifted-chat GitHub readme.md上:它提供了一些我们可以使用的道具。

我们感兴趣的是:

  

bottomOffset(整数) - 聊天距离底部的距离   屏幕(例如,如果显示标签栏,则非常有用)

我的应用程序中有多个聊天屏幕,因此我通过传递一个名为offsetFix的道具来有条件地应用修复程序,用于选项卡隐藏的屏幕。这是代码:

<GiftedChat
    loadEarlier={...}

    isLoadingEarlier={...}
    messages={...}
    onSend={(message) => {...}}
    user={{
        _id: ...
        name: ...,
        avatar: ...,
    }}
    showUserAvatar={...}
    renderActions={...}
    placeholder={'Type a message...'}
    // Setting the offset to 50 (my tab bar height), 
    // fixed it for me.
    bottomOffset={this.props.offsetFix ? 50 : 0} // <---------------------------
/>

希望有所帮助。