Ios 窗口不显示';不要填满所有的屏幕
我是Xamarin的初学者,这是我的第一个应用程序。我只做了第一步:创建一个视图。我的问题是它没有填满所有的屏幕。我删除了视图,然后创建了一个有同样问题的窗口 这是XIB:Ios 窗口不显示';不要填满所有的屏幕,ios,xamarin,xamarin.ios,mvvmcross,Ios,Xamarin,Xamarin.ios,Mvvmcross,我是Xamarin的初学者,这是我的第一个应用程序。我只做了第一步:创建一个视图。我的问题是它没有填满所有的屏幕。我删除了视图,然后创建了一个有同样问题的窗口 这是XIB: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6211" syste
<?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.
}
}
public分部类LoginView:BaseView
{
public LoginView():base(“LoginView”,null)
{
}
公共覆盖无效DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
//释放所有未使用的缓存数据、图像等。
}
公共覆盖无效ViewDidLoad()
{
base.ViewDidLoad();
NavigationController.NavigationBarHidden=true;
//加载视图后,通常从nib执行任何附加设置。
}
}
BaseView:
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; }
}
公共抽象类BaseView:MvxViewController,IView其中TViewModel:IViewModel
{
专用IConfigurationService配置服务;
私有IGlobalizationService globalizationService;
公共BaseView(字符串nibName,NSBundle bundle):基本(nibName,bundle)
{ }
公共IConfigurationService配置服务
{
得到
{
if(this.configurationService==null)
{
this.configurationService=Mvx.Resolve();
}
返回此.configurationService;
}
}
公共IGlobalizationService全球化服务
{
得到
{
if(this.globalizationService==null)
{
this.globalizationService=Mvx.Resolve();
}
返回此.globalizationService;
}
}
公共新TViewModel ViewModel
{
获取{return(TViewModel)base.ViewModel;}
设置{base.ViewModel=value;}
}
解决方案是在ViewDidLoad函数中添加此代码
NavigationController.NavigationBarHidden = true;
可能与我使用的MVVM Cross重复,所以我不使用UIViewController或启动屏幕。我也不使用Xcode…我使用Visual Studio开发。我自己启动屏幕,但没有通过info调用。plistHi Daniel,你是如何构建视图或ViewController的?MvvmCross只是一个围绕本机iOS ViewCont的非常薄的包装roller..你能展示实际视图控制器的代码或者你是如何创建视图的吗?我们需要更多的信息来继续。@Stephanvs我还添加了一个捕获。谢谢你的时间。我对按钮没有任何问题。我很高兴你解决了它,但是你对“窗口没有填满屏幕”的描述非常不准确