Recent articles


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




Error occurred while installing package Xamarin.Android.Support.v7.AppCompat -Version 26.0.2

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


The below error occurred while trying to run below command on my Xamarin Project.
Install-Package Xamarin.Android.Support.v7.AppCompat -Version 26.0.2
Install failed. Rolling back...
Package 'Xamarin.Android.Support.v7.AppCompat.26.0.2' does not exist in project 'FrameAnimation'
Package 'Xamarin.Android.Support.v7.AppCompat.26.0.2' does not exist in folder 'C:\Users\Srikanth\Documents\Visual Studio 2017\Projects\FrameAnimation\packages'
Executing nuget actions took 507.71 ms
Install-Package : Could not install package 'Xamarin.Android.Support.v7.AppCompat 26.0.2'. You are trying to install this
package into a project that targets 'MonoAndroid,Version=v7.1', but the package does not contain any assembly references or
content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ Install-Package Xamarin.Android.Support.v7.AppCompat -Version 26.0.2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Fix:
Steps to Fix this issue:
1)  Go to tools -> Android -> Android SDK Manager.
2)  Install Android 8.0.0 (APID 26) SDK Platform. If already installed go to next step.
3)  Go to Application properties and Set Compile using Android version: (target Framework) to Android 8.0 (Oreo).
4)  Close and Open the app once again.
5)  Now try to install the Package. It will install fine.

Tags: Xamarin.Android.Support.v7.AppCompat -Version 26.0.2