如何创建一个视图,大于屏幕? [英] How to create a view that is bigger than the screen?

查看:143
本文介绍了如何创建一个视图,大于屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能创建一个视图,大于屏幕?

Is it possible to create a view that is bigger than the screen?

我需要,其具有更大的宽度则装置的画面的图。我用这个观点在旋转动画。在旋转过程中所没有在屏幕上视图动画之前的部分将变得可见。

I need a view that has a bigger width then the screen of the device. I use this view in a rotation animation. During the rotation the parts that were not on the screen before animating the view will become visible.

有没有办法实现这种效果与Android框架?

Is there a way to achieve this effect with the android framework?

更新

我试图把我的父母布局更大然后屏幕,它是工作。这将使出头一点点不舒服,但它可以工作。接下来的问题是,现在我的布局仍然启动屏幕的左侧。予想不到的方法的,使布局本身扩大到左边和屏幕的右侧。

I tried to set my parent layout much bigger then the screen and it is working. This will make somethings a little bit uncomfortable but it could work. The next problem now is that my layout still starts at the left side of the screen. I can't think of a method to make the layout to expand itself to the left and the right of the screen.

推荐答案

好吧,我得到了一个答案。这是不是很好,因为它采用的是德precated View类,但它的作品至少在我目前测试的屏幕分辨率其他分辨率测试的明天。

Ok I got an answer. It is not very nice because it uses a deprecated View class but it works at least on my current testing screen resolution other resolutions are tested tomorrow.

我包,我想扩大超出屏幕在这样一个绝对布局的观点:

I wrapped the view that I wanted to expand beyond the screen in an absolute layout like this:

<AbsoluteLayout
  android:layout_width="wrap_content"
  android:layout_height="fill_parent"
  android:layout_alignParentBottom="true">

  <ImageView
     android:id="@+id/content"
     android:layout_width="600dip"
     android:layout_height="420dip"
     android:scaleType="centerCrop"
     android:layout_x="-200dip"
     android:layout_y="60dip"
     android:src="@color/testcolor" />

</AbsoluteLayout>

的-200 x坐标使得视图粘200dip出在屏幕的左侧。如果我动画的看法那些画面外的部分将逐渐变得可见。

The -200 x coordinate makes the view stick 200dip out of the left side of the screen. If I'm animating the view those parts that are outside the screen will gradually become visible.

这篇关于如何创建一个视图,大于屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆