问题描述
我要权重设置为我的ProgressDialog内的消息。
我试过:
I want to set a right gravity to a message inside my ProgressDialog.I've tried to:
dialog = new ProgressDialog(activity);
dialog.getWindow().setGravity(Gravity.RIGHT);
dialog.setMessage(loadDialogMessage);
但是仍然消息的重力设定为正确的。
我该怎么做?
But still the gravity of the message is set to the right.How can I do that ?
推荐答案
这样的事情应该做的伎俩:
Something like this should do the trick :
ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setMessage("42 is the answer to life the universe and everything");
dialog.show();
TextView tvMessage = (TextView)dialog.findViewById(android.R.id.message);
tvMessage.setGravity(Gravity.RIGHT);
我只是看着源<一个href=\"http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.2_r1.1/android/app/ProgressDialog.java#147\" rel=\"nofollow\">http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.2_r1.1/android/app/ProgressDialog.java#147
并期待在TextView中的ID
I just looked at the source http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.2_r1.1/android/app/ProgressDialog.java#147and look at the textview's id
这篇关于设置权重为ProgressDialog内部消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!