简体   繁体   中英

Updating viewcontroller after loading .Xib file

I have a .Xib file which have a custom view in Xamarin.ios. This Xib file ,I have added in a viewcontroller. Now as per the flow first methods of viewcontroller class first loads, then it loads Xib file.

I have certain functionalities due to which I need to update a method in viewcontroller class,after the .xib file loads.

Lets say I want to change the decrease the width of custom view in viewcontroller class,after the .xib file loaded.

It may be simple,I am new to ios ,So need help

You can try adding a constraint for the width of the custom view. Take a outlet of the constraint and change its constant when required and call layout if needed to reload the view.

 _width.Constraint.Constant = 100;
 View.LayoutIfNeeded (); // The view could be custom view or view controller's view.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM