小编Til*_*l S的帖子

密集时由键盘隐藏的ListView中的EditText

我有一个包含EditText的行的ListView.

当我单击EditText并且它尚未聚焦时它会获得焦点,键盘出现并且EditText被移动到CandidateView上方(所需的行为).

然而,当我按下键时,EditText保持焦点并接收输入但向下移动并被键盘遮挡(前一个移动被反转).

当我在没有显示键盘的情况下选择EditText时单击EditText,键盘会弹出,但EditText不会移动到正确的位置(CandidateView上方).它仍然接收输入.

我添加一个包含EditText的标题视图,一切正常.

这是我的ArrayAdapter的代码,其中创建了行视图:

View view = inflater.inflate(R.layout.row_profile_entry_text, null);


final String question = getItem(position);

TextView textViewQuestion = (TextView) view.findViewById(R.id.rpeq_TextViewQuestion);
textViewQuestion.setText(question);

final EditText editTextAnswer = (EditText) view.findViewById(R.id.rpeq_EditTextAnswer);

editTextAnswer.addTextChangedListener(new TextWatcher() {
    @Override
    public void onTextChanged(CharSequence s, int start, int before, int count) {
    }

    @Override
    public void beforeTextChanged(CharSequence s, int start, int count,
            int after) {
    }

    @Override
    public void afterTextChanged(Editable s) {
        mAnswers.put(question, s.toString());
    }
});

if (mAnswers.containsKey(question)) {
    editTextAnswer.setText(mAnswers.get(question));
}

return view;
Run Code Online (Sandbox Code Playgroud)

我还要强调,我已经添加
android:windowSoftInputMode="adjustPan"到Manifest和
android:descendantFocusability="beforeDescendants"ListView中,因为大多数其他问题的答案都表明了这一点.

没有 …

android listview focus android-edittext

10
推荐指数
1
解决办法
5966
查看次数

Socialauth-android获取oAuth-token并在设备上使用帐户信息

我正在使用socialauth-android库通过Facebook,Twitter和LinkedIn登录用户.

到目前为止,我找不到一种方法来获取oAuth-token.有没有办法在不重新实现库的部分的情况下访问它?

此外,当我想使用socialauth登录时(请参阅下面的代码)我必须手动输入用户名和密码,尽管我已经使用该设备设置了所有帐户.你能告诉socialauth使用这个帐户吗?

buttonFacebook.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            mSocialAdapter.authorize(ActivityLogin.this, Provider.FACEBOOK);
        }
    });
Run Code Online (Sandbox Code Playgroud)

android oauth socialauth

9
推荐指数
1
解决办法
1951
查看次数

标签 统计

android ×2

android-edittext ×1

focus ×1

listview ×1

oauth ×1

socialauth ×1