programming4us
programming4us
MOBILE

Developing BlackBerry Tablet Applications : OS Interactions - Screen Options

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

There are several options available to programmatically control several areas of the screen layout. These options determine the layout of the application, whether to show the action bar in View-Based or Tabbed application, and whether to show the application in full-screen mode. This sample application is shown in Figure 1.

1. Layout

The options for your application layout are portrait, where the application shows vertically in the device; or landscape, where the application shows horizontally in the device. Setting the aspect ratio by calling the setAspectRatio method on the stage can change the application’s layout. The StageAspectRatio class contains two static values that should be used to set the aspect ratio.

The following code includes a RadioGroup with the ID of orientation. There are two RadioButton components in this group with values of portrait and landscape. When clicking on one of these radio buttons, the radiobutton1_clickHandler method is called. Within this method, the orientation.selectedValue is tested. If orientation.selectedValue is equal to portrait, the stage.setAspectRatio method is called and StageAspectRatio.PORTRAIT is passed in. If orientation.selectedValue is equal to landscape, the stage.setAspectRatio method is called and StageAspectRatio.LANDSCAPE is passed in. The results are pictured in Figure 2.

2. ActionBar

The ActionBar is the built-in navigation that comes along with the View-Based or Tabbed application layouts. This bar consumes significant screen real estate. Therefore, the option to hide and show it programmatically is available to you as the developer.

The following code includes a CheckBox with the label “Show ActionBar”. This CheckBox is set to “selected” by default, as that is the normal state of the ActionBar. When clicking on this CheckBox to check or uncheck the value, the checkbox2_clickHandler is called. The actionBarVisible property of this view is set to the value of the CheckBox. The results are pictured in Figure 3, which shows an application that is in full screen with the ActionBar hidden.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView">

<fx:Script>
<![CDATA[
protected function checkbox2_clickHandler(event:MouseEvent):void
{
this.actionBarVisible = event.target.selected;
}

protected function radiobutton1_clickHandler(event:MouseEvent):void
{
if(orientation.selectedValue == "portrait"){
stage.setAspectRatio(StageAspectRatio.PORTRAIT);
} else if(orientation.selectedValue == "landscape"){
stage.setAspectRatio(StageAspectRatio.LANDSCAPE);
}
}

]]>
</fx:Script>

<fx:Declarations>
<s:RadioButtonGroup id="orientation"/>
</fx:Declarations>

<s:VGroup top="20" left="10">
<s:CheckBox click="checkbox2_clickHandler(event)" label="Show ActionBar"
selected="true"/>
<s:RadioButton groupName="orientation" value="portrait" label="Portrait"
click="radiobutton1_clickHandler(event)" selected="true"/>
<s:RadioButton groupName="orientation" value="landscape" label="Landscape"
click="radiobutton1_clickHandler(event)"/>
</s:VGroup>


</s:View>


Figure 1. Screen Options Application


Figure 2. Landscape Mode


Figure 3. ActionBar Hidden

Other  
  •  Developing BlackBerry Tablet Applications : OS Interactions - StageWebView
  •  Developing BlackBerry Tablet Applications : OS Interactions - Splash Screen
  •  Developing BlackBerry Tablet Applications : OS Interactions - Open in Browser
  •  iPhone Developer : Assembling Views and Animations - Transforming Views
  •  iPhone Developer : Assembling Views and Animations - Randomly Moving a Bounded View
  •  iPhone Developer : Assembling Views and Animations - Working with View Frames (part 2) - Other Utility Methods
  •  iPhone Developer : Assembling Views and Animations - Working with View Frames (part 1) - Adjusting Sizes , CGRects and Centers
  •  iPhone Developer : Assembling Views and Animations - View Geometry
  •  Windows Phone 7 : Drawing with Vertices and Matrices - Drawing Primitives
  •  Windows Phone 7 : Understanding Matrix Transformations (part 3) - Drawing Multiple Objects at Different Positions
  •  
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    - Messages forwarded by Outlook rule go nowhere
    - Create and Deploy Windows 7 Image
    - How do I check to see if my exchange 2003 is an open relay? (not using a open relay tester tool online, but on the console)
    - Creating and using an unencrypted cookie in ASP.NET
    - Directories
    - Poor Performance on Sharepoint 2010 Server
    - SBS 2008 ~ The e-mail alias already exists...
    - Public to Private IP - DNS Changes
    - Send Email from Winform application
    - How to create a .mdb file from ms sql server database.......
    programming4us programming4us
    programming4us
     
     
    programming4us