Nexus 7布局尺寸(Nexus 7 7.02和#34;)

时间:2016-05-31 17:38:07

标签: android android-layout nexus-7

我正在学习Android开发,并使用Android Studio尝试了几个简单的应用。我无法弄清楚的一个问题是Nexus 7屏幕(布局)尺寸。

这是我做的:

  1. 使用Andriod Studio(最新版本:2.1.1)创建一个包含一个空活动的新项目。没有改变任何东西并在Nexus 7 API 19(4.4)仿真器上运行它。该应用推出了默认的“Hello,world!'信息。

  2. 我改变了res / values / strings.xml,如下所示:

  3. <resources>
    <string name="app_name">Sample Layout Size (Default)</string>  
    </resources>
    

    当应用启动时,屏幕显示如下: screen shot on Nexus 7

    1. 我创建了新文件夹res / values-large,并在其下创建了新的strings.xml文件。 strings.xml的内容是:
    2. <resources>
      <string name="app_name">Sample Layout Size (Large)</string>
      </resources>
      

      我期待在Nexus 7上启动应用时,应用标题将更改为样本布局大小(大)。但事实并非如此。它仍然将应用标题显示为样本布局大小(默认)

      我创建了另一个虚拟设备 Nexus 7 API 23 并在其上启动了应用程序,结果相同。

      我在 Nexus 9 API 23 上再次启动了应用,这次标题更改为示例布局尺寸(大)

      我还创建了另一个文件夹res/values-sw600dp,并在此目录下使用新的strings.xml,指定应用程序名称为样本布局大小(SW 600DP)。不工作。使用默认值仍然是相同的结果:样本布局大小(默认)标题。

      所以在我看来,Nexus 7仍在使用默认布局。我已经阅读了有关Nexus 7的Stack Overflow上的几篇帖子,但没有一篇与我的相同。

      据我所知,Nexus 7是一款旧设备,所以我想知道多屏幕支持是否已经改变以处理这些设备。

      以下是Nexus 7仿真器的属性:

      Name: Nexus_7_API_23
      CPU/ABI: Google APIs Intel Atom (x86)
      Path: C:\Users\Nathan\\.android\avd\Nexus_7_API_23.avd
      Target: google_apis [Google APIs] (API level 23)
      Skin: nexus_7_2013
      SD Card: 100M
      hw.dPad: no
      runtime.network.speed: full
      hw.accelerometer: yes
      hw.device.name: Nexus 7 2013
      vm.heapSize: 64
      hw.device.manufacturer: Google
      hw.gps: yes
      image.androidVersion.api: 23
      hw.audioInput: yes
      image.sysdir.1: system-images\android-23\google_apis\x86\
      tag.id: google_apis
      hw.camera.back: none
      hw.mainKeys: no
      AvdId: Nexus_7_API_23
      hw.camera.front: none
      hw.lcd.density: 320
      runtime.scalefactor: auto
      avd.ini.displayname: Nexus 7 API 23
      hw.gpu.mode: auto
      hw.device.hash2: MD5:47dc70fd92541dd16c19f9efa3e9db62
      hw.ramSize: 1536
      hw.trackBall: no
      hw.battery: yes
      hw.sdCard: yes
      tag.display: Google APIs
      runtime.network.latency: none
      hw.keyboard: yes
      hw.sensors.proximity: no
      disk.dataPartition.size: 800M
      hw.sensors.orientation: yes
      avd.ini.encoding: UTF-8
      hw.gpu.enabled: yes
      

      附件是故障设备的配置。 avd config

2 个答案:

答案 0 :(得分:1)

我认为他们建议现在使用private void signIn() { try{ Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN); } catch(Exception ex){ //write to us your ex.getMessage(); } } ,但如果不起作用,您可以创建def main(): mainDB = {} loop = True while loop: print('\t\t\t Student Database') print('------------------------------------------------------') print('K: Key in a record') print('D: Display the records') option = input('Enter an option: ') if option == 'k' or option == 'K': # Create a new dictionary subDB = {} # ask the user to enter student first and last name firstLastName = input('Enter student\'s first and last name: ') # ask the user to enter the id number and phone number idNumber = int(input('Enter student id number: ')) phoneNumber = int(input('Enter student phone number: ')) # AT THIS STAGE I DO NOT KNOW HOW TO CREATE A DICTIONARY WITH A SINGLE KEY WITH MULTIPLE VALUES # update the main database mainDB.update(subDB) print('Success') elif option == 'd' or option == 'D': # display the main database print(mainDB) main() sw600dp个文件夹。希望这有帮助!

答案 1 :(得分:0)

enter image description here

尝试添加

<强>布局sw600dp-土地tvdpi

<强>布局sw600dp端口-tvdpi