Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Creating Svg in Android

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 309
    Comment on it

    Creating Svg images reduces the effort of putting different resolution drawable (png's).

    Steps to Create Svg images.

    1. Right Click on drawable folder,Select New ,Select Vector Image. (view attachment vector_asset.png).
    2. Choose the material icon / local svg(view attachment vector_asset2.png ) .
    3. Name your resource file (view attachment vector_asset.3png).
    4. Click next and Finish.

    You will find new xml file in your drawable (ic_aspect_ratio_24dp in my case).

    Add the generated xml to your source or background.

     <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imgThum"
        android:src="@drawable/ic_aspect_ratio_24dp"
        android:layout_below="@+id/btn_camera"
        />
    

    It will supports all the resolution .

    Thanks

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: