开发者

problem while text editing in android

I have a edittext field in my android. When I am editing cursor showing only one letter. But when I press back key its showing all letters. What to do to show letters while typing. my layout would be like this:

<EditText
android:id="@+id/conPW"
android:layout_width="248px"
android:layo开发者_运维技巧ut_height="43px"
android:textSize="18sp"
android:password="true"
android:layout_x="20px"
android:layout_y="152px"
>
</EditText>

thanks in advance


Ehh...you're setting android:password="true" - this is the field that gives you only one letter shown at the time.

Just remove that if you don't want it to function in this fashion?

Also, I would really not be using pixels as your layouts width & height, but that's for you to decide. It's not good practice in terms of different screen resolutions and whatnot. Use wrap_content / fill_parent and dp or sp.

http://developer.android.com/guide/practices/screens_support.html

What is the difference between "px", "dp", "dip" and "sp" on Android?


It is not the coding issue. It is a Android emulator issue. Have you tested it on device?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜