Recent articles


How to place two buttons side by side in Relative Layout in Xamarin Android?

Posted by seven.srikanth@gmail.com at 12 Nov 2017 in Article


Below example of code will help you to place two buttons side by side.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:minWidth="25px"
    android:minHeight="25px">
    <Button
        android:id="@+id/ok"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:text="OK"
        android:layout_alignParentRight="true"
        android:layout_marginLeft="10dip" />
    <Button
        android:text="Cancel"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_toLeftOf="@id/ok"
        android:layout_alignTop="@id/ok" />
</RelativeLayout>
Explanation: Following code in Cancel Button android:layout_toLeftOf="@id/ok" and android:layout_alignTop="@id/ok" will help the Button to be placed left to OK button with matching the top.

Tags: Relative Layout; Side by Side Buttons;




How to Place an ImageView at center within linearlayout in xamarin android?

Posted by seven.srikanth@gmail.com at 10 Nov 2017 in Article


Below code will help you to center a ImageView within linearlayour in Xamarin android.
 
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:gravity="center_vertical|center_horizontal">
    <ImageView
        android:id="@+id/animated_android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@anim/animate_android" />
</LinearLayout>
Thanks.

Tags: ImageView; linearlayout;




How to centre an Imageview in Xamarin Android?

Posted by seven.srikanth@gmail.com at 10 Nov 2017 in Article


Below code will help you to centre an Imageview in Xamarin Android.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:gravity="center_vertical|center_horizontal">
    <ImageView
        android:id="@+id/animated_android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@anim/animate_android" />
</LinearLayout>
Thanks,

Tags: Imageview