2017년 1월 31일 화요일

자마린 스튜디오(Xamarin Studio)에서 변환(Translation) 사용하기

웹에서는 css를 사용해서 변환이나 애니메이션 효과를 줄 수 있습니다. 
iOS에도 다양한 코코아 기반의 변환과 애니메이션 효과를 줄 수 있습니다. 자마린에서는 재물에서 제공하는 선언된 태그를 사용해서 비슷하게 효과를 낼 수 있습니다. 
슬라이더를 변경하면 x축과 y축이 변경되는 것을 볼 수 있다.


<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:DemoTranslation" x:Class="DemoTranslation.DemoTranslationPage">

    <StackLayout Padding="20, 10">
        <Frame x:Name="frame" 
                HorizontalOptions="Center"
                VerticalOptions="CenterAndExpand"
                OutlineColor="Accent">

            <Label Text="TEXT"
                    FontSize="Large" />
        </Frame>

        <Slider x:Name="xSlider"
                Minimum="-200"
                Maximum="200"
                Value="{Binding Source={x:Reference frame}, 
                    Path=TranslationX}" />
         <Label Text="{Binding Source={x:Reference xSlider},
             Path=Value,
             StringFormat='TranslationX = {0:F0}'}"
             HorizontalTextAlignment="Center" />
        <Slider x:Name="ySlider"
            Minimum="-200"
             Maximum="200"
             Value="{Binding Source={x:Reference frame},
             Path=TranslationY }" />
         <Label Text="{Binding Source={x:Reference ySlider},
             Path=Value,
             StringFormat='TranslationY = {0:F0}'}" />
    </StackLayout>
</ContentPage>


댓글 없음:

댓글 쓰기

참고: 블로그의 회원만 댓글을 작성할 수 있습니다.

테슬라 차량이 무인 배송이 된 역사적인 사건입니다. ㅎㅎ

테슬라는 꿈을 그리는 기업입니다. 좀 황당하고 무섭기도 한데 시간이 지연되고 있지만 꾸준하게 발전하는 모습을 보여줍니다.  테슬라 차량을 주문한 고객이 무인 배송으로 차를 받는 영상입니다. ㅋㅋ  이러다가 정말 화성 탐사선에 옵티머스 로봇이 탑재되는 ...