最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android實(shí)現(xiàn)固定屏幕顯示的方法

 更新時(shí)間:2015年07月14日 17:17:41   作者:鑒客  
這篇文章主要介紹了Android實(shí)現(xiàn)固定屏幕顯示的方法,實(shí)例分析了Android屏幕固定顯示所涉及的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

本文實(shí)例講述了Android實(shí)現(xiàn)固定屏幕顯示的方法。分享給大家供大家參考。具體如下:

在Android開發(fā)中我們會(huì)碰到開發(fā)屏幕扭轉(zhuǎn)的情況,如何固定住屏幕ScreenOrientation 呢?

在學(xué)習(xí)jetboy代碼時(shí),發(fā)現(xiàn)屏幕被旋轉(zhuǎn)了,代查代碼沒有找到相關(guān)設(shè)置,在manifest.xml中找到了相關(guān)的代碼:

找到這名代碼:

復(fù)制代碼 代碼如下:
android:screenOrientation="portrait"

portrait表示橫向,landscape表示縱向

如果要使Activity的View界面全屏,只需要將最上面的信號(hào)欄和Activity的Title欄隱藏掉即可,隱藏Title欄的代碼:

復(fù)制代碼 代碼如下:
requestWindowFeature(Window.FEATURE_NO_TITLE);

配置文件里代碼:

復(fù)制代碼 代碼如下:
android:theme="@android:style/Theme.NoTitleBar"

 
隱藏信號(hào)欄的代碼:
復(fù)制代碼 代碼如下:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

 
其它使用:
復(fù)制代碼 代碼如下:
getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR, WindowManager.LayoutParams.TYPE_STATUS_BAR);

 
至此Android開發(fā)中的屏幕固定問題就解決了!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.android.jetboy" android:versionCode="1"
  android:versionName="1.0.0"> 
  <application android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar"> 
    <activity android:name=".JetBoy"
      android:label="@string/app_name"
      android:screenOrientation="portrait"
      > 
      <intent-filter> 
        <action android:name="android.intent.action.MAIN" /> 
        <category 
          android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
    </activity> 
  </application> 
  <uses-sdk android:minSdkVersion="4"></uses-sdk> 
  <!--  
  <uses-library android:name="android.test.runner" /> 
  <instrumentation 
  android:name="android.test.InstrumentationTestRunner" 
  android:targetPackage="com.example.android.jetboy" 
  android:functionalTest="true" android:label="Jetboy Test All Runner"/>    
  <uses-permission android:name="android.permission.RUN_INSTRUMENTATION"/> 
   --> 
</manifest> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.example.android.jetboy" android:versionCode="1"
 android:versionName="1.0.0">
 <application android:icon="@drawable/icon"
 android:label="@string/app_name"
 android:theme="@android:style/Theme.NoTitleBar">
 <activity android:name=".JetBoy"
  android:label="@string/app_name"
  android:screenOrientation="portrait"
  >
  <intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category
   android:name="android.intent.category.LAUNCHER" />
  </intent-filter>
 </activity>
 </application>
 <uses-sdk android:minSdkVersion="4"></uses-sdk>
 <!--
 <uses-library android:name="android.test.runner" />
 <instrumentation
  android:name="android.test.InstrumentationTestRunner"
  android:targetPackage="com.example.android.jetboy"
  android:functionalTest="true" android:label="Jetboy Test All Runner"/>  
 <uses-permission android:name="android.permission.RUN_INSTRUMENTATION"/>
 -->
</manifest>

希望本文所述對(duì)大家的Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

大冶市| 舒兰市| 潮安县| 曲阜市| 蓬溪县| 邯郸市| 维西| 南岸区| 新和县| 荃湾区| 旬阳县| 化州市| 石屏县| 边坝县| 奇台县| 额敏县| 个旧市| 海口市| 吕梁市| 武乡县| 墨脱县| 盐城市| 孟连| 遵义市| 即墨市| 通许县| 富民县| 江城| 赤壁市| 通山县| 澄江县| 右玉县| 温泉县| 寿光市| 天门市| 广德县| 建湖县| 惠安县| 西宁市| 宁安市| 常州市|