一些EditTexts的价值观似乎迁移到其他EditTexts [英] Values of some EditTexts seem to move to other EditTexts
问题描述
我一直有一些奇怪的问题, EditTexts
,我在排我的的ListView
。
I've been having a strange problem with some EditTexts
that I have in rows of my ListView
.
基本上,用户从一个活动选择一些练习,当他点击了一个按钮一个新的活动推出,他需要为他选择的练习输入信息。这些信息包括重量,代表和集。
Basically the user chooses some exercises from one activity and when he clicks on the next button a new activity launches where he needs to enter information for the exercises that he has chosen. This information includes weights, reps and sets.
一些练习可能不需要砝码。如果这是我设置了重量
的EditText
在 ListView控件的情况下
来启用假行:
Some exercises may not require weights. If this is the case I set the weight
EditText
in the ListView
row to enabled to false:
EditText weight = (EditText)v.findViewById(R.id.weightChosen);
CustomExercisesDB exs = new CustomExercisesDB(cont);
exs.open();
int weightable = exs.isWeightable(chosenExercisesNames.get(position));
exs.close();
if(weightable==0)
{
weight.setEnabled(false);
}
以上code被放置在 getView
我的自定义适配器的的ListView
。
现在,如果让我们说用户选择3的练习,其中一人不要求重量,然后在那里他需要输入的信息对每个重活动如下:
Now if lets say the user has selected 3 exercises, and one of them doesn't require weights, then the activity where he needs to enter the information for each weight looks like this:
当用户点击两的EditText
第一个练习中键入一些价值观,键盘弹出,用户对每个的EditText
在第一个练习。
When the user clicks on the two EditText
of the first exercise to type some values, the keypad pops up and the user enters some values for each EditText
in the first exercise.
现在的问题是,当用户可以说点击返回按钮,在 EditTexts
输入的第一个练习的价值观似乎跳到最后两个 EditTexts
在的ListView
最后的锻炼。事情是这样的:
Now the issue is when the user lets say hits the return button, the values entered in the EditTexts
for the first exercise seem to jump to the last two EditTexts
of the last exercise in the ListView
. Something like this:
这是不对的,因为这些信息应为选择向上推
,而不是肩preSS $ C设置$ C>。
This is not right as this information should be set for the Pick Push up
, instead of the Shoulder press
.
到底是什么造成这个问题,我怎样才能克服它。
What exactly is causing this problem, and how can I overcome it.
请告诉我,如果你从我的code,你的感觉是有关需要什么。我不想包含了很多code的,可能是无关紧要的。
Please tell me if you need anything else from my code that you feel is relevant. I didn't want to include a lot of code that may be irrelevant.
另外,如果我再次点击回的 EditTexts
第一运动之一,从数值上一个练习跳回到他们。这就像我进入被挂的价值观外 EditTexts
键,键盘弹出,似乎让他们跳来跳去。
Also if I click back again on one of the EditTexts
of the first exercise, the values jump back to them from the last exercise. It's like the values I enter are "hanging" outside the EditTexts
and the keypad popping up seems to make them jump around.
感谢
推荐答案
我已经解决了这个问题。
I have solved the problem.
如果任何人都面临着类似的问题,所有你需要做的就是地方的android:windowSoftInputMode =adjustPan
在清单
活动下。
If anyone faces a similar issue, all you have to do is place android:windowSoftInputMode="adjustPan"
in the manifest
under the activity.
那么,我进入每个练习的信息的活动就叫做 SetCustomExercisesInfo
和我放在的android:windowSoftInputMode =adjustPan
在里面。
So the activity where I enter the information for each exercise is called SetCustomExercisesInfo
and I placed android:windowSoftInputMode="adjustPan"
in it.
<activity
android:name=".SetCustomExercisesInfo"
android:label="@string/setCusExInfo"
android:windowSoftInputMode="adjustPan" >
</activity>
这篇关于一些EditTexts的价值观似乎迁移到其他EditTexts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!