相关疑难解决方法(0)

使用自定义键盘中可见的候选视图重新调整UI

我正在使用自定义键盘.我在onCreateCandidatesView()中设置了setCandidatesViewShown(true)函数,问题是UI没有得到正确的重新调整.

任何帮助都会很棒.以下就是我所做的

@Override 
public View onCreateCandidatesView() {      

    LayoutInflater li = (LayoutInflater) getApplicationContext()
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View wordBar = li.inflate(R.layout.wordbar, null);
    LinearLayout ll = (LinearLayout) wordBar.findViewById(R.id.words);
    Button voiceCmd = (Button) wordBar.findViewById(R.id.voiceword);
    LinearLayout ll1 = null;
    Button voiceCmd1 = null;
    //comment this block in the event of showing only one keyboard so that we can only
    //one autocorrect bar
    if (isLargeScreen) {
        ll1 = (LinearLayout) wordBar.findViewById(R.id.words1);
        voiceCmd1 = (Button) wordBar.findViewById(R.id.voiceword1);
    }

    voiceCmd.setOnClickListener(voiceClickListener);

    mCandidateView = new CandidateView(this);
    mCandidateView.setService(this);
    setCandidatesViewShown(true);
    mCandidateView.setLayoutParams(new LayoutParams(
            LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

    ll.addView(mCandidateView);             

    return …
Run Code Online (Sandbox Code Playgroud)

android android-softkeyboard

6
推荐指数
1
解决办法
2054
查看次数

标签 统计

android ×1

android-softkeyboard ×1