Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能告诉我如何使用 xib 但不使用情节提要在导航栏上添加段控制器?它仅适用于 iphone,不适用于 ipad。
将 UIToolBar 拖到您的 XIB 顶部。然后将 UIsegmentControl 拖到上面。这样您将获得一个自定义导航栏。
如果出现默认的 iphone navigationBar..在其 viewWillAppear 中添加以下代码
[self.navigationController setNavigationBarHidden:YES];
浏览此链接一次。这可能会给出一个想法。
http://books.google.co.in/books?id=rk1EEL4WpFEC&pg=PA504&lpg=PA504&dq=Add+segment+Controller+in+Navigation+Bar+through+xib+%2B+iphone+sdk&source=bl&ots=KVUnDOmKA6&sig=wPiJj18ZVCgCp_ScZ7m0o4Ou- H4&hl=en#v=onepage&q=Add%20segment%20Controller%20in%20Navigation%20Bar%20through%20xib%20%2B%20iphone%20sdk&f=false