ApplicationBar (hereinafter referred to as AppBar) is a very common WP application control, but also very convenient. The common practice is to pivot or panorama the page switch, appbar Follow the button or do not display buttons, such as.
This method is relatively simple, the Internet is easy to find information, but I will briefly say.
First to add the required appbar in the page resource, I have added two silver appbar here. A default mode, a minimized mode.
<phone:PhoneApplicationPage.Resources> <shell:applicationbar x:key="appbar_1"Backgroundcolor="Silver"Mode="Default"isvisible="True"> <shell:applicationbariconbutton iconuri="/assets/appbar1/add.png"text="Add"/> <shell:applicationbariconbutton iconuri="/assets/appbar2/check.png"text="Confirm"/> </shell:ApplicationBar> <shell:applicationbar x:key="appbar_2"Backgroundcolor="Silver"Ismenuenabled="True"Mode="minimized"isvisible="True"> </shell:ApplicationBar> </phone:PhoneApplicationPage.Resources>
Then the corresponding AppBar is modified in the SelectionChanged event of Pivot, and the third one is null without appbar.
Private voidPivot_selectionchanged (Objectsender, SelectionChangedEventArgs e) { if(Pivot. SelectedIndex = =0) {ApplicationBar= (Microsoft.Phone.Shell.ApplicationBar) resources["appbar_1"]; } Else if(Pivot. SelectedIndex = =1) {ApplicationBar= (Microsoft.Phone.Shell.ApplicationBar) resources["appbar_2"]; } Else if(Pivot. SelectedIndex = =2) {ApplicationBar=NULL ; } }
The effect is the previous GIF effect, but you now go back to see the front that GIF will find the switch when there is a black bar, occurs when the AppBar change height, in my actual use if you add appbarmenu words, will produce more obvious black bar, and cause very, very, very, very noticeable stuttering. (The machine on hand is 920)
This problem is simply a pit, the online information is very few, so I spread the way to find it ('? ') ), set the AppBar opacity (transparency) to 0.99.
<phone:PhoneApplicationPage.Resources> <shell:applicationbar x:key="appbar_1"Backgroundcolor="Silver"Mode="Default"isvisible="True"opacity="0.99"> <shell:applicationbariconbutton iconuri="/assets/appbar1/add.png"text="Add"/> <shell:applicationbariconbutton iconuri="/assets/appbar2/check.png"text="Confirm"/> </shell:ApplicationBar> <shell:applicationbar x:key="appbar_2"Backgroundcolor="Silver"Ismenuenabled="True"Mode="minimized"isvisible="True"opacity="0.99"> </shell:ApplicationBar> </phone:PhoneApplicationPage.Resources>
The same color transparency 0.99 and 1 can not see bad, but solved the black stripe problem and performance problems, things will become this, how to think are Microsoft's fault ...
The GIF below is the effect of opacity changed to 0.99, no black bar is much smoother.
<WP8 Development Learning Note >applicationbar (taskbar) and "Black Bar Problem"