Cov txheej txheem:

Kuv yuav hloov cov xim navigation bar hauv Swift li cas?
Kuv yuav hloov cov xim navigation bar hauv Swift li cas?

Video: Kuv yuav hloov cov xim navigation bar hauv Swift li cas?

Video: Kuv yuav hloov cov xim navigation bar hauv Swift li cas?
Video: Customize Navigation Bar 2024, Kaum ib hlis
Anonim

Hloov navigation bar xim

  1. Nyob rau hauv kev txiav txim hloov xim ntawm navigation bar rau tag nrho cov saib controllers, koj muaj teeb nws hauv AppDelegate. nrawm ntaub ntawv.
  2. Ntxiv cov cai hauv qab no rau didFinishLaunchingWithOptions ua haujlwm hauv AppDelegate. nrawm .

Tom qab ntawd, kuv yuav hloov xim ntawm kuv lub bar navigation hauv Xcode li cas?

  1. Siv Daim Ntawv Qhia Tus Kheej, xaiv koj Txoj Kev Taw Qhia.
  2. Hauv Tus Kws Saib Xyuas Tus Cwj Pwm, hauv pab pawg Navigation Bar, hloov Cov Qauv los ntawm Default rau Dub.
  3. Hauv tib pab pawg Navigation Bar, hloov Bar Tint rau xim ntawm koj nyiam.

Tsis tas li ntawd, kuv yuav siv qhov bar navigation hauv Xcode li cas? Xaiv cov npe zaub mov scene los ntawm txhaj rau nws qhov chaw nres nkoj. Xaiv Editor> Embed In> Kev taw qhia Maub los. Xcode ntxiv ib qho tshiab kev taw qhia maub los rau koj storyboard, teem lub storyboard nkag taw tes rau nws, thiab muab cov zaub mov scene raws li nws cov hauv paus saib maub los.

Ib sab saum toj no, kuv yuav hloov lub khawm rov qab xim hauv Swift li cas?

Koj ua tau hloov lub ntiaj teb tint xim nyob rau hauv koj storyboard los ntawm txhaj rau ntawm qhov chaw khoob ntawm lub rooj tsavxwm thiab xaiv nyob rau hauv txoj cai toolbar "Qhia cov ntaub ntawv soj ntsuam", thiab koj yuav pom nyob rau hauv qab ntawm lub toolbar qhov kev xaiv "Ntiaj teb Tint". Koj tuaj yeem siv zoo li no. Muab tso rau hauv AppDelegate. nrawm.

Kuv yuav ntxiv navigation bar ntawm Iphone li cas?

Mus rau ntawm Storyboard. Xaiv qhov Saib Maub los thiab hauv Editor Editor xaiv Embed hauv -> Navigation Controller . Tom ntej no, luag a Bar Khawm los ntawm Object Library mus rau sab laug ntawm lub Navigation Bar thiab muab nws lub npe "Lav Khoom". Rov ua qhov no rau sab xis thiab npe nws "Txoj Cai Khoom".

Pom zoo: