首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Java > 示例项目说明问题我面临冲方向变化相关失效。

示例项目说明问题我面临冲方向变化相关失效。

资 源 简 介

This project illustrates an issue I had while working with drawables and screen orientation in Android. The sequence of steps to recreate the issue is: Create an Activity with android:configChanges="orientation". Create a layout portrait.xml which has one ImageView whose android:src attribute is set to some PNG image (in my case "@drawable/content") Create a dummy layout landscape.xml that does nothing. In onCreate(), use LayoutInflater to inflate the 2 layouts onto two separate views - mLandscape and mPortrait. In onConfigurationChanged(), use setContentView() with the appropriate view passed in depending on orientation. If you are in portrait mode, use setBounds() to "cut" the drawable (say, to half its height).

文 件 列 表

InvalidateDrawable
.classpath
.project
AndroidManifest.xml
proguard.cfg
project.properties
assets
res
drawable
content.png
src
in
kmb
inval
Constants.java

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP
  • 11 1小时前 成为了本站会员

  • 开心快活人 4小时前 成为了本站会员

  • 晋财 5小时前 成为了本站会员

  • WYG 1天前 成为了本站会员

  • Shine 1天前 成为了本站会员

  • 柳贻 1天前 成为了本站会员

  • hallelujah_HL 1天前 成为了本站会员

  • 焦昱贺 1天前 成为了本站会员

  • Rubin 1天前 成为了本站会员

  • Li 2天前 成为了本站会员

0.191474s