Мой макет экрана представляет собой настраиваемый заголовок и переключатель, под которым находится GroupChannelFragment (с использованием GroupChannelInput по умолчанию).
Я использую KeyboardAvoidingView с поведением="padding", потому что альтернатива (behavior="height") имеет другие ошибки, а простое использование свойства Sendbird KeyboardAvoidOffset само по себе приводило к скрытию ввода.
Проблема (только для Android):
Код: Выделить всё
Initial Load: The GroupChannelInput is perfectly positioned at the bottom of the screen. (This is correct).
Keyboard Opens: A large gap appears between the top of the keyboard and the bottom of the input field. (See image 1).
Keyboard Closes: The GroupChannelInput does not return to the bottom. It gets "stuck" and "floats" with a permanent gap, which looks identical to the gap from when the keyboard was open. (See image 2).
Я измеряю высоту заголовка и переключателей и передаю их как KeyboardVerticalOffset. Это значение (keyboardOffset) правильное (около 173 пикселей).
Код: Выделить всё
{activeView === 'Chat' ? (
) : (
renderProfileView()
)}
Код: Выделить всё
const GroupChannelFragment = createGroupChannelFragment({
Header: () => null, // Hide the fragment's header since we have our own at the top
// Use Sendbird's default Input component (no custom Input prop)
});
Как правильно обернуть GroupChannelFragment на Android, чтобы учесть пользовательский заголовок без этого пробела или «плавающей» ошибки ввода?
Клавиатура открыта (обратите внимание на пробел)
Клавиатура закрыта (Обратите внимание на «плавающий» пробел)
Подробнее здесь: https://stackoverflow.com/questions/798 ... -android-w
Мобильная версия