草庐IT

landscape-portrait

全部标签

ios - UIInterfaceOrientation 总是在 AppDelegate iPad 中返回 Portrait?

我想在iPad应用程序中显示启动画面。在此之前,我想获取当前设备方向的横向或纵向模式。我用过,UIInterfaceOrientationorientation=[[UIApplicationsharedApplication]statusBarOrientation];if(orientation==UIInterfaceOrientationLandscapeRight||orientation==UIInterfaceOrientationLandscapeLeft){splachview=[[UIImageViewalloc]initWithFrame:CGRectMake(0

ios - ECSlidingViewController 2 landscape with Right Side Menu 有错误

我发现ECSlidingViewController旋转到横向时,View的大小没有调整。所以显示了一个很大的空白背景。它在人像中效果很好。这只发生在右侧菜单上。请在此处找到屏幕截图:landscape!portrait!2014年5月20日更新,子类ECSlidingViewController,添加这2个方法。但问题仍然存在。MyECSlidingViewController.m-(BOOL)shouldAutorotate{return[self.topViewControllershouldAutorotate];}-(NSUInteger)supportedInterface

ios - 更改 GADBannerView 中的广告尺寸

我集成了admob。我的应用程序支持纵向和横向模式。在纵向模式下,它工作得很好,但横向模式没有改变广告大小。在横向模式下,横幅View广告包含左右空间。如何改变广告尺寸?请帮助我。 最佳答案 如果您正在寻找全宽广告,请使用智能横幅格式:-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toIntduration:(NSTimeInterval)duration{if(UIInterfaceOrientationIsLandscape(toInt)){sel

ios - Cordova : iOS and iPad stuck in portrait mode

我在根目录下的config.xml中添加了以下内容但是好像没有效果,app一直卡在竖屏模式。我还确保禁用方向锁定。有什么想法吗?....... 最佳答案 这是一个错误,iPad的默认方向应该是所有方向无论如何,如果你想在iPhone和iPad上拥有所有方向,你可以使用“所有”方向值 关于ios-Cordova:iOSandiPadstuckinportraitmode,我们在StackOverflow上找到一个类似的问题: https://stackoverf

iphone - Landscape 中的 UIActionSheet 的 buttonIndicies 不正确

我有一个操作表让我在iPhone的横向模式上感到悲伤。一切都显示得很好,但在Landscape中,第一个真正的按钮与取消按钮具有相同的索引,因此逻辑不起作用。我已经尝试使用initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles:创建actionSheet,但那是一样的,我当前的代码如下;UIActionSheet*actionMenu=[[UIActionSheetalloc]init];actionMenu.delegate=self;actionMenu.title=fold

Android - ImageView 显示 "landscape"中图库中的图像

首先,也许“风景”不是更好的形容词,但我现在想不出另一个词。我正在使用以下代码在ImageView中显示图像,但我使用“纵向”(抬头)设备拍摄的图像显示为侧边。我的代码:mImageView=(ImageView)findViewById(R.id.iv_photo);Uriu=Uri.parse("content://media/external/images/media/7");mImageView.setImageURI(u);XML:是的,“content://media/external/images/media/7”是一个有效路径。有什么想法吗?

android - Fragment Dialog landscape,填满屏幕

我的fragment对话框有问题,如果手机处于纵向模式,一切正常,对话框几乎是全屏的,但是当我旋转手机时,在横向模式下,两侧有一些大间隙。有可能解决这个问题吗?我称之为getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);去掉DIalogFragment标题。我使用的是线性布局。 最佳答案 解决方法:@OverridepublicvoidonStart(){super.onStart();Dialogdialog=getDialog();if(dialog!=

android - 在 AndroidManifest.xml 中设置 screenOrientation 不起作用

我有一个简单的helloworldAndroid测试项目。在我的AndroidManifest.xml中,我已经设置了android:screenOrientation="portrait"android:configChanges="keyboardHidden|keyboard|orientation">但是当我调试我的代码时,变量isLandscape是True,而它应该是FalsebooleanisLandscape=getResources().getConfiguration().orientation==Configuration.ORIENTATION_LANDSCAP

android - "Landscape"和 "Landscape-reverse"方向的不同布局

我的问题:对于某些要求,我的Activity需要两种不同的xml布局:一个用于横向模式。还有一个用于Landscape-reverse模式(横向颠倒)。不幸的是,Android不允许为横向反转创建单独的布局(就像我们可以使用layout-land和layout-port为纵向和横向做的那样)。据我所知,唯一的方法是从java代码更改activity-xml。我尝试过的:1)重写onConfigurationChanged()方法来检测方向变化,但我不知道它是Landscape还是Landscape-reverse:@OverridepublicvoidonConfigurationCh

在纵向和横向之间切换时,Android整数xml资源值不会改变

我使用以下GradientDrawable作为RelativeLayout的背景:然后在res\values文件夹中创建一个名为integers.xml的文件:90res\values-land文件夹下的另一个同名文件:180因此,当我旋转设备时,在运行Android2.3.3时(如预期的那样),渐变从底部->顶部到右->左,但是当我在Android4.4.4上测试时,渐变角度不会改变。我也尝试过:90但结果相同。有什么想法吗?更新:使用GradientDrawable的RelativeLayout存在于2个不同的文件中:res\layout\my_layoutres\layout-l