设置会话页面输入框默认提示(hint)和光标样式

如何设置会话页面输入框默认提示(hint)和光标样式
发布时间: 2018-05-03 17:32

回答:

1、获取输入框控件EditText,需要自定义会话页面

public class ChatConversationFragment extends ConversationFragment {

    private RelativeLayout containerView;

    private RongExtension extension;

    private EditText inputEditText;

    @Override

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        containerView = (RelativeLayout) super.onCreateView(inflater, container, savedInstanceState);

        extension = (RongExtension) containerView.findViewById(io.rong.imkit.R.id.rc_extension);

        inputEditText = extension.getInputEditText();

        return containerView;

    }

}

注意:在添加会话页面的时候:

<fragment

    android:id="@+id/conversation"

    android:name="所在路径.ChatConversationFragment"

    android:layout_width="match_parent"

    android:layout_height="match_parent" />

2、调用EditText相关方法设置hint和样式


我对此仍有疑问!继续追问