J2ME 技術(shù)的學(xué)習(xí)與實(shí)踐者

          導(dǎo)航

          <2008年3月>
          2425262728291
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          統(tǒng)計(jì)

          常用鏈接

          留言簿(2)

          隨筆分類(lèi)

          隨筆檔案

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          [導(dǎo)入]OpenBaseMovil 設(shè)備檢測(cè)(1)


          網(wǎng)站: JavaEye  作者: iwinyeah  鏈接:http://iwinyeah.javaeye.com/blog/168955  發(fā)表時(shí)間: 2008年03月07日

          聲明:本文系JavaEye網(wǎng)站發(fā)布的原創(chuàng)博客文章,未經(jīng)作者書(shū)面許可,嚴(yán)禁任何網(wǎng)站轉(zhuǎn)載本文,否則必將追究法律責(zé)任!

          以下代碼由bm.core.tools.DeviceInfo.java抽出,詳見(jiàn)該文件
              private void testFontListBug()
              {
                  if( isNokia() )
                  {
                      // 就算是Nokia的設(shè)備也要進(jìn)行一下測(cè)試來(lái)確定是否有這個(gè)Bug
                      final Font font = Font.getFont(
                              Font.FACE_PROPORTIONAL,
                              Font.STYLE_PLAIN,
                              Font.SIZE_SMALL
                      );
                      final List list = new List( "", List.IMPLICIT );
                      for( int i = 0; i < 3; i++ )
                      {
                          list.append( "", null );
                      }
                      for( int i = 0; i < 3; i++ )
                      {
                          list.setFont( i, font );
                      }
                      list.deleteAll();
                      try
                      {
                      for( int i = 0; i < 4; i++ )
                          {
                              list.append( "", null );
                          }
                          listFontBug = false;
                      }
                      catch( Throwable e )
                      {
                          listFontBug = true;
                      }
                  }
                  else
                  {
                      // 除Nokia設(shè)備外,其它設(shè)備都假定它有這個(gè)Bug
                      // 不知道實(shí)際上是不是這樣呢?我估計(jì)大部分的手機(jī)都有這個(gè)問(wèn)題
                        // 不然他不會(huì)這么做
                      listFontBug = true;
                  }
              }
          
          

          那么這個(gè)Bug是什么呢?
          我在bm.mvc.ListBrowserView中找到如下代碼:
              if( !DeviceInfo.getDeviceInfo().hasListFontBug() )
              {
                  final int itemCount = list.size();
                  for( int i = 0; i < itemCount; i++ )
                  {
                      list.setFont( i, Util.SMALL_FONT );
                  }
              }
          

          也就是說(shuō),有這個(gè)Bug的設(shè)備不能將List的項(xiàng)的字體更改為SMALL_FONT
          本文的討論也很精彩,瀏覽討論>>


          JavaEye推薦




          文章來(lái)源:http://iwinyeah.javaeye.com/blog/168955

          posted on 2008-03-07 09:46 iwinyeah 閱讀(78) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 崇州市| 余干县| 灵宝市| 河源市| 沾化县| 旬阳县| 宁津县| 井研县| 砚山县| 浪卡子县| 黑龙江省| 陆川县| 新丰县| 仲巴县| 瓮安县| 云南省| 那曲县| 大英县| 竹溪县| 清苑县| 三河市| 保山市| 全椒县| 长子县| 铜梁县| 海林市| 岗巴县| 新余市| 怀柔区| 蚌埠市| 白朗县| 临泉县| 安龙县| 莫力| 梨树县| 隆安县| 当雄县| 富川| 永清县| 秀山| 河北省|