What conditions are required for the InputAccessoryView component to function correctly in React Native?
4 phương ánCó giải thích
Các phương án trả lời
Chọn một phương ánLời giảiChọn phương án để mở
Đáp án đúng gồm hai ý: "The TextInput component must have an inputAccessoryViewID prop whose value matches the value of the nativeID prop of the corresponding InputAccessoryView component." và "Any custom toolbar you want to display above the keyboard needs to be wrapped inside an InputAccessoryView component, and that InputAccessoryView component must have a nativeID assigned.". InputAccessoryView (chỉ có trên iOS) cho phép gắn một thanh công cụ tuỳ biến ngay phía trên bàn phím; cơ chế liên kết là cặp định danh: thanh công cụ được bọc trong InputAccessoryView có nativeID, còn TextInput trỏ tới nó qua inputAccessoryViewID cùng giá trị, nên khi ô nhập được focus thì bàn phím hiện kèm thanh đó. Phát biểu "as a direct child of the TextInput component" sai vì TextInput không nhận con kiểu này, liên kết đi qua ID chứ không qua quan hệ cha con. Phát biểu "Simply declaring the InputAccessoryView component anywhere" sai vì chỉ khai báo mà không khớp nativeID với inputAccessoryViewID thì không ô nhập nào biết dùng thanh công cụ ấy.
Cùng chương 2
A View component can be nested inside other views. Select the correct option.Có lời giảiCâu hỏiWhich component is the foundation for all React Native components and provides the base functionality for rendering elements to the screen?Có lời giảiCâu hỏiWhich keyword is used to extend a component from a base component?Có lời giảiCâu hỏiCả 54 câu của chủ đề54 câu