gpt4 book ai didi

ios - 窗口没有填满整个屏幕

转载 作者:行者123 更新时间:2023-11-29 12:06:17 26 4
gpt4 key购买 nike

我是 Xamarin 的初学者,这是我的第一个应用程序。我只是在做第一步:创建一个 View 。我的问题是它没有填满整个屏幕。我删除了 View ,然后创建了一个具有相同问题的窗口。

这是 XIB:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LoginView">
<connections>

<outlet property="window" destination="7" id="176-fQ-JAJ"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="7">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
<point key="canvasLocation" x="-0.2000008" y="20.2"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Label" lineBreakMode="tailTruncation" minimumFontSize="10" id="8" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES">
<rect key="frame" x="139" y="33" width="42" height="21"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</window>
</objects>
<resources>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_120x120.png" width="120" height="120"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_152x152.png" width="152" height="152"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_180x180.png" width="180" height="180"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_29x29.png" width="29" height="29"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_40x40.png" width="40" height="40"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_58x58.png" width="58" height="58"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_76x76.png" width="76" height="76"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_80x80.png" width="80" height="80"/>
<image name="Media.xcassets/AppIcons.appiconset/ic_launcher_87x87.png" width="87" height="87"/>
</resources>
</document>

我做错了什么?提前致谢。

编辑。

 public partial class LoginView : BaseView<LoginViewModel>
{
public LoginView() : base("LoginView", null)
{
}

public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();

// Release any cached data, images, etc that aren't in use.
}

public override void ViewDidLoad()
{
base.ViewDidLoad();

NavigationController.NavigationBarHidden = true;
// Perform any additional setup after loading the view, typically from a nib.
}

}

基础 View :

 public abstract class BaseView<TViewModel> : MvxViewController, IView<TViewModel> where TViewModel : IViewModel
{
private IConfigurationService configurationService;
private IGlobalizationService globalizationService;

public BaseView(string nibName, NSBundle bundle) : base(nibName, bundle)
{ }

public IConfigurationService ConfigurationService
{
get
{
if (this.configurationService == null)
{
this.configurationService = Mvx.Resolve<IConfigurationService>();
}

return this.configurationService;
}
}
public IGlobalizationService GlobalizationService
{
get
{
if (this.globalizationService == null)
{
this.globalizationService = Mvx.Resolve<IGlobalizationService>();
}

return this.globalizationService;
}
}
public new TViewModel ViewModel
{
get { return (TViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}

This is how the view is shwoing

最佳答案

解决方案是在 ViewDidLoad 函数中添加此代码

        NavigationController.NavigationBarHidden = true;

关于ios - 窗口没有填满整个屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34886309/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com