绘制土地VS绘土地、VS

由网友(我姓吴i)分享简介:我不使用布局土地,但也有绘土地。I am not using a layout-land, but do have drawable-land.问题是,它使用任何绘相匹配的方向活动时的开始即可。我想它使用可绘制/绘土地的时候,手机旋转之间切换。有没有一种方法可以轻松地做到这一点?或者我应该只是复制和粘贴我的布局到布...

我不使用布局土地,但也有绘土地。

I am not using a layout-land, but do have drawable-land.

问题是,它使用任何绘相匹配的方向活动时的开始即可。我想它使用可绘制/绘土地的时候,手机旋转之间切换。有没有一种方法可以轻松地做到这一点?或者我应该只是复制和粘贴我的布局到布局的土地,因此,它实际上是重新创建活动? (我认为会做正确的事情,但我非常希望它使用的是正确一位刚刚刷新绘制,当我旋转)

The problem is, it uses whichever drawable matches the orientation when the activity starts. I would like it to switch between using the drawable/drawable-land when the phone rotates. Is there a way to do this easily? Or should I just copy and paste my layout into layout-land, so that it actually recreates the activity? (I assume that would do the right thing, but ideally I would like it to just refresh the drawable using the correct one when I rotate)

推荐答案

您可以即手动

Display mDisplay= activity.getWindowManager().getDefaultDisplay();
int width= mDisplay.getWidth();
int Height= mDisplay.getHeight();

if(width>height)
{
//Landscape
//set your landscape drawable
}
else
{
//portrait
//set your portrait drawable
}

这样的话没有必要创建可绘制土地文件夹还

so then no need to create "Drawable-land" folder also

阅读全文

相关推荐

最新文章