Wednesday, October 23, 2013

Android-Screen-Anchoring Views

Anchoring Views

Anchoring could be easily achieved by using RelativeLayout. Consider the following main.xml containing five Button views embedded within the element:

android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
xmlns:android=”http://schemas.android.com/apk/res/android”
>

Anchoring Views


Anchoring Views

Observe the following attributes found in the various Button views:
➤ layout_alignParentLeft — Aligns the view to the left of the parent view
➤ layout_alignParentRight — Aligns the view to the right of the parent view
➤ layout_alignParentTop — Aligns the view to the top of the parent view
➤ layout_alignParentBottom — Aligns the view to the bottom of the parent view
➤ layout_centerVertical — Centers the view vertically within its parent view
➤ layout_centerHorizontal — Centers the view horizontally within its parent view
Figure shows the activity when viewed in portrait mode.

When the screen orientation changes to landscape mode, the four buttons are aligned to the four edges of the screen, and the center button is centered in the middle of the screen with its width fully stretched (see Figure)

Upload UIImage as base64 String

Upload UIImage as Base64 String (Upload UIImage as string) //Select Pic From Camera or Gallery       @objc func btnPro...