`
wang_peng1
  • 浏览: 3905384 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

输入键盘始终停留以及尺寸转换得到默认字体大小

阅读更多
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); 
imm.showSoftInput(activeView, 0); 

 或者

<activity android:windowSoftInputMode="stateAlwaysVisible">

两种方法都可以。

 

 

输入法中的<activity android:windowSoftInputMode="adjustPan"> 是用来调解距离的。

 

 

转换decimal feet 到 feet and inches如

12.5 feet to 12ft 6in

int feet = (int)length; 
int inches = (length - feet) * 12.0; 
: : 
farf
.setText (feet + " ft, " + inches + " inches"); 
或者

 

float measurement = 12.5; 
int feet = (int)measurement; 
float fraction = measurement - feet; 
int inches = (int)(12.0 * fraction);

 

 

 

得到默认字体

float size = new TextView(this).getTextSize(); 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics