EditTex 弹出软件胖的问题

gujinf2008 2011-03-31 06:50:11
EditTex 默认是会弹出软键盘的,我自己写了一个dailog,继承的是alertdialog,界面里有个edittext,点击它,不弹出然键盘了,这样我就输入不聊中文了,怎样才能弹出软键盘呢?qq中病毒,上不了,郁闷呢。
...全文
94 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
gujinf2008 2011-06-01
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 yangting_lisa 的回复:]
谢谢你的回答,我的问题和你的有点不一样。麻烦帮我一下。setContentView(R.layout.*)中的layout xml我加了背景。如果我用alertdialog的setContentView方法样式是对的,但是edittext软键盘不可以用。如果我用dailog的setContentViewe方法edittext可以弹出键盘,但是样式不对,即使我设置成没有标题的模式,外面还是有一个黑色……
[/Quote]
可以设置dialog的样式的,把背景设置成透明的,你设置样式应该是通过value下的style设置的吧。
gujinf2008 2011-06-01
  • 打赏
  • 举报
回复
[Quote=引用 16 楼 yangting_lisa 的回复:]
我已经自己找到解决办法了,谢谢你对我的帮忙。thanks
[/Quote]
哦,那就好,不客气。
小笨熊 2011-06-01
  • 打赏
  • 举报
回复
我已经自己找到解决办法了,谢谢你对我的帮忙。thanks
小笨熊 2011-06-01
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 yangting_lisa 的回复:]

设置dialog的样式?不太明白。。。我的样式是在xml中写好的。我只是使用setContentView(mView)放进去的。但是最外面有一个黑色的框子把我的dialog给包起来了,我现在就像去掉那个黑色的外框。
[/Quote]

requestWindowFeature这个方法设置了没有标题。
我的背景是黑色图片的,在xml中写的。最外面多白色边框,打错了不是黑色边框。原本就只是我的xml显示就可以了,但是怎么去掉白色边框呢?
小笨熊 2011-06-01
  • 打赏
  • 举报
回复
设置dialog的样式?不太明白。。。我的样式是在xml中写好的。我只是使用setContentView(mView)放进去的。但是最外面有一个黑色的框子把我的dialog给包起来了,我现在就像去掉那个黑色的外框。
小笨熊 2011-05-31
  • 打赏
  • 举报
回复
谢谢你的回答,我的问题和你的有点不一样。麻烦帮我一下。setContentView(R.layout.*)中的layout xml我加了背景。如果我用alertdialog的setContentView方法样式是对的,但是edittext软键盘不可以用。如果我用dailog的setContentViewe方法edittext可以弹出键盘,但是样式不对,即使我设置成没有标题的模式,外面还是有一个黑色边框,去不掉。样式和期望的不一样。
gujinf2008 2011-05-30
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 yangting_lisa 的回复:]
怎么解决的,告诉我下。我也遇到这个问题了
[/Quote]
原来我继承的是alertdialog,改成继承dailog就没这个问题了。
小笨熊 2011-05-26
  • 打赏
  • 举报
回复
怎么解决的,告诉我下。我也遇到这个问题了
JiuJie_ 2011-04-01
  • 打赏
  • 举报
回复
可能是你的EditText没有获取到焦点。
你仔细检查下,在edittext可以添加requestFoucus()之类的属性,让它获取焦点。
gujinf2008 2011-04-01
  • 打赏
  • 举报
回复
dialog是自己写的,继承自alertdialog,在oncreate函数里,setcontextview(),将xml文件加载进去,代码如下
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//this.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
//getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);

setContentView(R.layout.login_dialog);
gujinf2008 2011-04-01
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id = "@+id/layout_root"
android:orientation = "vertical"
android:layout_width="220dip"
android:layout_height="280dip"
>
<TextView android:text="请输入账号" android:id="@+id/account_view" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize = "18dip"></TextView>
<Spinner android:id="@+id/account_value" android:layout_width="220dip" android:layout_height="wrap_content"
android:layout_marginTop = "10dip"></Spinner>
<TextView android:text="请输入密码" android:id="@+id/paw_view" android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize = "18dip"></TextView>
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="EditText" android:id="@+id/paw_value"
android:focusable = "true" android:layout_marginTop = "10dip"
></EditText>
<LinearLayout android:layout_width="wrap_content" android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:orientation = "horizontal"
android:layout_marginBottom = "10dip" android:layout_marginTop = "70dip">
<ImageButton android:layout_width="wrap_content" android:src="@drawable/icon" android:id="@+id/login_ok" android:layout_height="50dip"
></ImageButton>
<ImageButton android:layout_width="wrap_content" android:src="@drawable/icon" android:id="@+id/login_back" android:layout_height="50dip"
android:layout_marginLeft = "70dip" android:layout_marginRight = "10dip"></ImageButton>
</LinearLayout>
</LinearLayout>
gujinf2008 2011-04-01
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 seasons_in_the_sun 的回复:]
在Dialog里的也是有的。
[/Quote]还是不管用啊
男主角 2011-04-01
  • 打赏
  • 举报
回复
在Dialog里的也是有的。
男主角 2011-04-01
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="There's beautiful girl above."
android:digits=".123)"
/>
</LinearLayout>


通过运行 ,没问题,焦点(即光标)在上面动动,就会弹出来,反应没那么快
我这是三个选项JAPANEASE IME .ANDROID KEYBOARD,还有个搜狗输入法。我用ANDROID 键盘。权用英文表达。

你贴我的去试试,要是不行。 你退到主页面,点击settings-->LANGUAGE AND KEYBOARD -->ANDROID KEYBOARD.或者是搜狗。然后返回。或者退出。重新运行。
念茜 2011-03-31
  • 打赏
  • 举报
回复
系统软键盘是个view
念茜 2011-03-31
  • 打赏
  • 举报
回复
系统自带的软键盘,少导包了吧
男主角 2011-03-31
  • 打赏
  • 举报
回复
代码,上来,给试试。

80,359

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧