Search Results

Search found 9305 results on 373 pages for 'loading animation'.

Page 11/373 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • UIView animation doesn't work first time

    - by BobC
    Hello everybody, I have a seachButton in the navigation bar which upon hitting calls following method: - (IBAction)search:(id)sender { if (nil == searchViewController) searchViewController = [[SearchViewController alloc] initWithNibName:@"SearchViewController" bundle:nil]; searchViewController.view.backgroundColor = [UIColor clearColor]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:searchViewController.view cache:NO]; [self.view addSubview:searchViewController.view]; [UIView commitAnimations]; } It should load SearchViewController.xib which contains a view with UISearchBar and two buttons. When I call the search method for the first time, the view appears very quickly with some weird animation, when I call it again, the animation is alright. Does anyone have a clue what could be wrong?

    Read the article

  • Handling inverse kinematics: animation blending or math?

    - by meds
    I've been working for the past four days on inverse kinematics for my game engine. I'm working on a game with a shoestring budget so when the idea of inverse kinematics came up I knew I had to make it such that the 3D models bones would be mathematically changed to appear to be stepping on objects. This is causing some serious problems with my animation, after it was technically implemented the animations started looking quite bad when the character was wlaking up inclines or steps even though mathematically the stepping was correct and was even smoothly interpolating. So I was wondering, is it actually possible to get a smooth efficient inverse kinematic system based exclusively on math where bones are changed or is this just a wild goose chase and I should either solve the inverse kinematics problem with animation blending or don't do it at all?

    Read the article

  • Can not add a animation to a UIImageView:

    - by Flocked
    Hello, Im trying to add a animation to a UIImageView, but it always fails. Why? Here is the code: UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); animationImage = [[UIImageView alloc]initWithImage:newImage]; [self.view addSubview:animationImage]; CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:0.35]; [animation setTimingFunction:UIViewAnimationCurveEaseInOut]; animation.type = @"pageCurl"; animation.fillMode = kCAFillModeForwards; animation.endProgress = 0.58; [animation setRemovedOnCompletion:NO]; [[animationImage layer] addAnimation:animation forKey:@"pageCurlAnimation"];

    Read the article

  • Starting Frame-By-Frame Animation

    - by OceanBlue
    Hi, I have a basic question about starting a frame-by-frame animation. When I call the AnimationDrawable.start() method from my code directly, it doesn't seem to work. public void onCreate(Bundle savedInstanceState) { ... mAnimation.start(); ... } But if I put this line inside the onClick() callback method of a button, pressing the buton starts the animation. Why doesn't this line work in the code? Thanks!

    Read the article

  • WPF UserControl Embedded Animation

    - by Matt B
    Hi all, I have a UserControl called Beetle.xaml which has animation makeing the legs move. So far so good. I added this to my Background.xaml page by decaring the xmlns and xaml as: xmlns:my="clr-namespace:Intellident.Liber8.GUI.Theme.Jungle" and <my:Beetle VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="180,0,0,175"> <UserControl.RenderTransform> <MatrixTransform x:Name="trnBeetle" /> </UserControl.RenderTransform> </my:Beetle> However I get errors telling me that I can't declare my:Name as I'm in the wrong scope. I can't declare my:Name as this doesn't exist. How do I do this, I want to create a path animation on the beetle to make him walk around... Ta, Matt. EDIT: THought I'd point out that both Beetle.xaml and Background.xaml live in Intellident.Liber8.GUI.Theme.Jungle namescope.

    Read the article

  • Onclick starts gif animation and .mp3, how to sync across browsers

    - by user2958163
    So I am using a text-based jplayer (http://jplayer.org/latest/demo-04/) that I want to sync with a gif animation. Onclick the text link does two things -1. feed the jplayer an mp3 and 2. trigger an animation (via SwapImage). It is important for these two to start at the same time. Right now, this works perfectly in chrome/firefox but in IE and mobile browsers the audio lags considerably. I have tried with the audio preloaded (it is a small 40K mp3) and it makes no difference. I dont think its a bandwidth problem because the problem is the same on repeat clicks. Any pointers on how I can resolve this...

    Read the article

  • How to do animation using swing and clojure ?

    - by Humberto Pinheiro
    I'm trying to animate a chess piece in a board. First I created a java.util.Timer object that "scheduleAtFixedRate" a TimerTask implemented as a proxy function. So I kept a record of the piece to move (piece-moving-record) and when it's apropriate (when the user move the piece using the mouse) the TimerTask proxy function should be test if the record is not nil and execute the piece-moving function. The piece-moving function just updates the x and y coordinates of the piece, according to a vector pre-calculated. I put a add-watch on the piece-moving-record so when it changes it should repaint the board (canvas). The paint method tests if this piece-moving-record is not nil to paint it. The problem is that the animation doesn't appear. The piece just jump to the destiny, without the movement between. There is some problem with the animation scheme ou there is a better way to do it?

    Read the article

  • UIView animation

    - by iphonedevnoob
    I have a UIView(first view) on top of which I would like to display another UIView(second view). I display the second view using animation which causes the second view to be displayed for about 3/4 of the iPhone screen. The first view is visible underneath the animated second view. I would like to make changes to the first view as the second view is displayed. Any ideas on how I can achieve this. Right now, the animation completes, the second view is displayed and then I can change the first view. I would like to change the layout of the first screen as the second screen is being displayed. Any help is much appreciated.

    Read the article

  • Class Loading Deadlocks

    - by tomas.nilsson
    Mattis follows up on his previous post with one more expose on Class Loading Deadlocks As I wrote in a previous post, the class loading mechanism in Java is very powerful. There are many advanced techniques you can use, and when used wrongly you can get into all sorts of trouble. But one of the sneakiest deadlocks you can run into when it comes to class loading doesn't require any home made class loaders or anything. All you need is classes depending on each other, and some bad luck. First of all, here are some basic facts about class loading: 1) If a thread needs to use a class that is not yet loaded, it will try to load that class 2) If another thread is already loading the class, the first thread will wait for the other thread to finish the loading 3) During the loading of a class, one thing that happens is that the <clinit method of a class is being run 4) The <clinit method initializes all static fields, and runs any static blocks in the class. Take the following class for example: class Foo { static Bar bar = new Bar(); static { System.out.println("Loading Foo"); } } The first time a thread needs to use the Foo class, the class will be initialized. The <clinit method will run, creating a new Bar object and printing "Loading Foo" But what happens if the Bar object has never been used before either? Well, then we will need to load that class as well, calling the Bar <clinit method as we go. Can you start to see the potential problem here? A hint is in fact #2 above. What if another thread is currently loading class Bar? The thread loading class Foo will have to wait for that thread to finish loading. But what happens if the <clinit method of class Bar tries to initialize a Foo object? That thread will have to wait for the first thread, and there we have the deadlock. Thread one is waiting for thread two to initialize class Bar, thread two is waiting for thread one to initialize class Foo. All that is needed for a class loading deadlock is static cross dependencies between two classes (and a multi threaded environment): class Foo { static Bar b = new Bar(); } class Bar { static Foo f = new Foo(); } If two threads cause these classes to be loaded at exactly the same time, we will have a deadlock. So, how do you avoid this? Well, one way is of course to not have these circular (static) dependencies. On the other hand, it can be very hard to detect these, and sometimes your design may depend on it. What you can do in that case is to make sure that the classes are first loaded single threadedly, for example during an initialization phase of your application. The following program shows this kind of deadlock. To help bad luck on the way, I added a one second sleep in the static block of the classes to trigger the unlucky timing. Notice that if you uncomment the "//Foo f = new Foo();" line in the main method, the class will be loaded single threadedly, and the program will terminate as it should. public class ClassLoadingDeadlock { // Start two threads. The first will instansiate a Foo object, // the second one will instansiate a Bar object. public static void main(String[] arg) { // Uncomment next line to stop the deadlock // Foo f = new Foo(); new Thread(new FooUser()).start(); new Thread(new BarUser()).start(); } } class FooUser implements Runnable { public void run() { System.out.println("FooUser causing class Foo to be loaded"); Foo f = new Foo(); System.out.println("FooUser done"); } } class BarUser implements Runnable { public void run() { System.out.println("BarUser causing class Bar to be loaded"); Bar b = new Bar(); System.out.println("BarUser done"); } } class Foo { static { // We are deadlock prone even without this sleep... // The sleep just makes us more deterministic try { Thread.sleep(1000); } catch(InterruptedException e) {} } static Bar b = new Bar(); } class Bar { static { try { Thread.sleep(1000); } catch(InterruptedException e) {} } static Foo f = new Foo(); }

    Read the article

  • How To Disable Loading Of Images In Chrome, Firefox and IE

    - by Gopinath
    Many of us find the necessity to disable loading images in web browsers for various reasons. May be when we are at work place, we don’t our boss to notice flashy browser window or we are connected to low bandwidth connections like GPRS which works faster without images. What ever may be the reason, here are the tips to disable images in Google Chrome, Firefox and Internet Explorer web browsers. Google Chrome – Disable Loading Images To disable loading of images in Google Chrome 1. Click on Tools Icon and choose Options menu item 2. In Google Chrome Options dialog window, switch to the tab Under the hood and click on the button Content Settings 3. Select Images from the list of options available in the left panel and choose the option Do not show any images 4. Close dialog windows and you are done. Firefox – Disable Loading Images To disable loading of images in Firefox 1. Open Firefox 2. Go to Tools -> Options 3. Switch to Content tab 4. Uncheck the option Load images automatically Internet Explorer – Disable Loading Images To disable loading of images in Internet Explorer 1. Launch Internet Explorer 2. Go to Tools -> Internet Options 3. Switch to Advanced tab 4. Uncheck the option Show pictures under Multimedia category cc image credit: flickr/indoloony This article titled,How To Disable Loading Of Images In Chrome, Firefox and IE, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • segmented controls mangled during initial transition animation

    - by dLux
    greetings and salutations folks, i'm relatively new to objective c & iphone programming, so bare with me if i've overlooked something obvious.. i created a simple app to play with the different transition animations, setting up a couple segmented controls and a slider.. (Flip/Curl), (left/right) | (up/down), (EaseInOut/EaseIn/EaseOut/Linear) i created a view controller class, and the super view controller switches between 2 instances of the sub class. as you can see from the following image, the first time switching to the 2nd instance, while the animation is occurring the segmented controls are mangled; i'd guess they haven't had enuff time to draw themselves completely.. http://img689.imageshack.us/img689/2320/mangledbuttonsduringtra.png they're fine once the animation is done, and any subsequent times.. if i specify cache:NO in the setAnimationTransition it helps, but there still seems to be some sort of progressive reveal for the text in the segmented controls; they still don't seem to be pre-rendered or initialized properly.. (and surely there's a way to do this while caching the view being transitioned to, since in this case the view isn't changing and should be cacheable.) i'm building my code based on a couple tutorials from a book, so i updated the didReceiveMemoryWarning to set the instanced view controllers to nil; when i invoke a memory warning in the simulator, i assume it's purging the other view, and it acts like a first transition after loading, the view being transitioned to appears just like the image above.. i guess it can't hurt to include the code (sorry if it's considered spamming), this is basically half of it, with a similar chunk following this in an else statement, for the case of the 2nd side being present, switching back to the 1st..: - (IBAction)switchViews:(id)sender { [UIView beginAnimations:@"Transition Animation" context:nil]; if (self.sideBViewController.view.superview == nil) // sideA is active, sideB is coming { if (self.sideBViewController == nil) { SideAViewController *sBController = [[SideAViewController alloc] initWithNibName:@"SideAViewController" bundle:nil]; self.sideBViewController = sBController; [sBController release]; } [UIView setAnimationDuration:sideAViewController.transitionDurationSlider.value]; if ([sideAViewController.transitionAnimation selectedSegmentIndex] == 0) { // flip: 0 == left, 1 == right if ([sideAViewController.flipDirection selectedSegmentIndex] == 0) [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES]; else [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES]; } else { // curl: 0 == up, 1 == down if ([sideAViewController.curlDirection selectedSegmentIndex] == 0) [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; else [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; } if ([sideAViewController.animationCurve selectedSegmentIndex] == 0) [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; else if ([sideAViewController.animationCurve selectedSegmentIndex] == 1) [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; else if ([sideAViewController.animationCurve selectedSegmentIndex] == 2) [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; else if ([sideAViewController.animationCurve selectedSegmentIndex] == 3) [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [sideBViewController viewWillAppear:YES]; [sideAViewController viewWillDisappear:YES]; [sideAViewController.view removeFromSuperview]; [self.view insertSubview:sideBViewController.view atIndex:0]; [sideBViewController viewDidAppear:YES]; [sideAViewController viewDidDisappear:YES]; } any other tips or pointers about writing good clean code is also appreciated, i realize i still have a lot to learn.. thank u for ur time, -- d

    Read the article

  • jQuery - Stucked Animation

    - by v1n_vampire
    I'm kind of tired with Javascript long script for animation and decide to try jQuery, but it seems I'm stuck even at the simplest code. CSS: #menu {float: right; font: italic 16px/16px Verdana, Geneva, sans-serif;} ul#nav {list-style: none;} ul#nav li {float: left; padding-right: 10px;} ul#nav li a {color: white;} ul#subnav {float: right; list-style: none; padding: 0; display: none;} ul#subnav li {float: left; padding: 10px 5px; white-space: nowrap;} ul#subnav li a {color: white;} Script: $(document).ready(function() { $('.nav').hover(function() { $(this).find('#subnav').stop().animate({width:'toggle'},350); }); }); HTML: <div id="menu"> <ul id="nav"> <li class="nav"> <a href="#"><img src="images/icon-home.png" width="36" height="36"/></a> <ul id="subnav"> <li><a href="#">Home</a></li> </ul> </li> <li class="nav"> <a href="#"><img src="images/icon-signin.png" width="36" height="36"/></a> <ul id="subnav"> <li><a href="#">Sign In</a></li> </ul> </li> <li class="nav"> <a href="#"><img src="images/icon-register.png" width="36" height="36"/></a> <ul id="subnav"> <li><a href="#">Create Account</a></li> </ul> </li> <li class="nav" style="padding-right: 0;"> <a href="#"><img src="images/icon-mail.png" width="36" height="36"/></a> <ul id="subnav"> <li style="padding-right: 0;"><a href="#">Contact Us</a></li> </ul> </li> </ul> </div> Here's the sample page: http://v1n-vampire.com/dev/jq-animation-stuck If you continue to hover on the nav from left to right then back to left, eventually the animation will stuck. How to solve this? Thank you in advance.

    Read the article

  • So how I can control the page contents loading sequence in dojo

    - by David Zhao
    Hi there, I'm using dojo for our UI's, and would like to load certain part of page contents in sequence. For example, for a certain stock, I'd like to load stock general information, such as ticker, company name, key stats, etc. and a grid with the last 30 days open/close prices. Different contents will be fetched from the server separately. Now, I'd like first load the grid so the user can have something to look at, then, say, start loading of key stats which is a large data set takes longer time to load. How do I do this. I tried: dojo.addOnLoad(function() { startGrid(); //mock grid startup function which works fine getKeyStats(); //mock key stat getter function also works fine }); But dojo is loading getKeyStats(), then startGrid() here for some reason, and sequence doesn't seem be matter here. So how I can control the loading sequence at will? Thanks in advance! David

    Read the article

  • Help me understand Rails eager loading

    - by aaronrussell
    I'm a little confused as to the mechanics of eager loading in active record. Lets say a Book model has many Pages and I fetch a book using this query: @book = Book.find book_id, :include => :pages Now this where I'm confused. My understanding is that @book.pages is already loaded and won't execute another query. But suppose I want to find a specific page, what would I do? @book.pages.find page_id # OR... @book.pages.to_ary.find{|p| p.id == page_id} Am I right in thinking that the first example will execute another query, and therefore making the eager loading pointless, or is active record clever enough to know that it doesn't need to do another query? Also, my second question, is there an argument that in some cases eager loading is more intensive on the database and sometimes multiple small queries will be more efficient that a single large query? Thanks for your thoughts.

    Read the article

  • Creating a loading screen in HTML5

    - by espais
    I am having some issues finding a decent tutorial for generating a loading style screen with regards to HTML5. To be quite honest I'm not sure exactly where to begin... My project is essentially a simple HTML5 game, where I'll be loading in various sprite sheets and tilesets. They'll be reasonably small, but I'd like to show a little loading spinner instead of a blank screen while all the resources are loaded. Much appreciated if somebody could point me in the right direction, be it decent links or code samples to get me going...my Google-fu is lacking today! For clarification, I need to figure out how to load the resources themselves, as opposed to finding a spinner. For instance, how to calculate that X% has loaded.

    Read the article

  • Page loading effect with jquery

    - by Andy Simpson
    Hello all, Is there a way to use jquery (or other method) to display a loading div while page loads? I have a table that is populated using PHP/MySQL and can contain several thousand rows. This is then sorted using the tablesorter plugin for jquery. Everything works fine, however the page can sometimes take 4-5 seconds to fully load and it would be nice to display a 'loading...' message within a div which automatically disappears when whole table is loaded. I have heard of loadmask plugin for jquery - would this be suitable for my needs and if not any alternative? No AJAX calls are being made while loading this table if thats relevant. Thanks in advance Andy

    Read the article

  • WPF touch and slide/drag animation

    - by George
    I'm trying to create a pretty simple WPF interface, and from what I know this should be mostly possible using pure XAML. What I know I have a pretty basic understanding of WPF so far, however I have a decent grasp on XAML. I know or can work out how to put content in these panels. This isn't the topic of this question. What I don't know I don't know how to animate this interface. I'm not very proficient at binding, however again, that's not the topic of this question. The topic of this question is what would be the best way to animate panels 1-4 (images below) so that they may be dragged (via touch) into view. The number of panels here may be static for the purpose of this question. The panels (1-4) can be stack panels, grids or whatever; their content isnt important. What is important is the container that would contain all 4 panels. The complication in this animation is the other two containers here (Item One/TODO), as they're in the way of a smooth animation. If it makes this question simpler, the touch features can be ignored for now, and a simple button push can slide the containers across. One Two

    Read the article

  • iPhone SDK : UIImageView - Collapsing animation

    - by chris.o.
    Hi All, I'm trying to animating across the screen a horizontal bar with a color gradient. For simplicity, I chose to make a png of the fully extended bar, assign it to a UIImageView, and (attempt to) animate resizing of it using a UIView animation. The problem is that in the "closed" state of the Image, the portion of the image showing is not the part that I want. The image is arranged so that from L to R, a white to red color gradient occurs. The right side (about 20 pixels) is solid red and is the part I want to show when the bar is "collapsed". I'm trying to extend the image out by about 100 pixels to its full width. I referenced the "Buy Now" button example for my code as it seemed relevant" http://stackoverflow.com/questions/1669804/uibutton-appstore-buy-button-animation My code: [UIView beginAnimations:@"barAnimation" context:nil]; [UIView setAnimationDuration:0.6]; CGRect barFrame = bookBar.bounds; if (fExtendBar) { barFrame.origin.x -= 100; barFrame.size.width += 100; } else { barFrame.origin.x += 100; barFrame.size.width -= 100; } bookBar.frame = barFrame; [UIView commitAnimations]; I feel like this should be possible, maybe by setting an "offsetOfImage" to display in the UIImageView, but I can't seem to make it work. Also, I've noticed that the behavior is kind of consistent with what happens in Interface Builder when you resize an image. Then again, I would think there would be a way to override this behavior programmatically. Any suggestions (including other approaches) are welcome. Thanks, chris.o.

    Read the article

  • Jquery animation callback issues

    - by ChrisOPeterson
    I'm trying to build a simple carousel animation with jQuery. There are 3 viewable images at any one time with buttons to click on each side to go forward or backwards. The center image is raised up by 30px to be given prominence. When one of the buttons is pushed the center image should drop down then all three images move together left or right. The initial up and down animation works but on a callback none of the other animations will work. If I hard code the direction into them only one of them works. Is there something wrong with my current code or approach? ctr_right.click(function() { carouselAnimate("right") }); ctr_left.click(function() { carouselAnimate("left") }); function carouselAnimate(direction) { var offset = img_width + img_offset; img_focus.animate({"top": "+="+focus_offset}, "slow", function() { img_left.animate({direction: "-="+offset}, "slow"); img_focus.animate({direction: "-="+offset}, "slow"); img_right.animate({direction: "-="+offset}, "slow"); }); };

    Read the article

  • Stop jQuery animation prematurely

    - by jcovert
    Hi, I'm trying to fadeIn and fadeOut a transparent png using JQuery. Of course, it looks slick in Firefox, but significantly less than acceptable in IE (7 and 8). It's a known bug with IE, and unfortunately there doesn't seem to be much of a workaround. Basically what I'm doing is place a semi-transparent white rectangle over an image to make the image appear 'in the background'. I want to do this smoothly, and that's where fadeIn comes in. Because of the IE bug, however, I've been forced to fadeIn a completely opaque white rectangle over the image instead, making it unfortunately disappear. While this looks significantly better and is ALMOST what I'm looking for, it's still not acceptable. The user needs to be able to see SOME image on the page, albeit in the background. So my question is this: Is there a way to stop the fadeIn function (or any jquery animation, really) after animating for 75% of its expected animation time? This would leave my image 75% mixed the white rectangle, and I wouldn't have to deal with IE's nasty transparent png bug. Thanks!

    Read the article

  • when updating location.hash in Chrome the jQuery animation "freezes" for a second

    - by ubunut
    I'm trying to create a sort of "virtual gallery". I'm using Coda Slider 2.0 & jQuery v1.4.2 It behaves perfectly in IE, FF & Safari, but Chrome seems to reload/hang for a second when setting location.hash. This causes the jQuery animation to freeze for a second :S Example: http://hardyernst.dk/gallery.html try clicking on the navigation links above the pictures. The jQuery code that is being executed when clicking a navigation link: $('#coda-nav-' + sliderCount + ' a').each(function(z) { // What happens when a nav link is clicked $(this).bind("click", function() { offset = -(panelWidth*z); navClicks++; $(this).addClass('current').parents('ul').find('a').not($(this)).removeClass('current'); alterPanelHeight(z); currentPanel = z + 1; $('.panel-container', slider).stop().animate({ left: offset }, settings.slideEaseDuration, settings.slideEaseFunction, function(){ if (!settings.crossLinking) { return false; } // Don't change the URL hash unless cross-linking is specified }); }); }); if I add return false; at the end of the function. The animation will slide smoothly :)... BUT as you might have guessed the location.hash value remains unchanged :( I have tried setting the location.hash earlier in the function alas it did not change the behavior in Chrome Would be immensely grateful for any help :) Regards Ubunut

    Read the article

  • WPF: Selecting the Target of an Animation

    - by Phil Sandler
    I am trying to create a simple (I think) animation effect based on a property change in my ViewModel. I would like the target to be a specific textblock in the control template of a custom control, which inherits from Window. From the article examples I've seen, a DataTrigger is the easiest way to accomplish this. It appears that Window.Triggers doesn't support DataTriggers, which led me to try to apply the trigger in the style. The problem I am currently having is that I can't seem to target the TextBlock (or any other child control)--what happens is which the code below is that the animation is applied to the background of the whole window. If I leave off StoryBoard.Target completely, the effect is exactly the same. Is this the right approach with the wrong syntax, or is there an easier way to accomplish this? <Style x:Key="MyWindowStyle" TargetType="{x:Type Window}"> <Setter Property="Template" Value="{StaticResource MyWindowTemplate}"/> <Style.Triggers> <DataTrigger Binding="{Binding ChangeOccurred}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard BeginTime="00:00:00" Duration="0:0:2" Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=TextBlock}}" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)"> <ColorAnimation FillBehavior="Stop" From="Black" To="Red" Duration="0:0:0.5" AutoReverse="True"/> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> </DataTrigger> </Style.Triggers> </Style>

    Read the article

  • Apply Storyboard Animation to DataGridTemplateColumn depending on Binding value change

    - by Neo
    I have a DataGridTemplateColumn on a WPF DataGrid which has a binding to a double type. I wish to apply a Storyboard Animation when the value goes down and another Storyboard Animation when the value goes up. I've got the following code to start with: <dg:DataGridTemplateColumn Header="My Double"> <dg:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=MyDouble, NotifyOnTargetUpdated=True}" TargetUpdated="dgRates_TargetUpdated"> <TextBlock.Triggers> <EventTrigger RoutedEvent="Binding.TargetUpdated"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:2" From="1.0" To="0.0" /> </Storyboard> </BeginStoryboard> </EventTrigger> </TextBlock.Triggers> </TextBlock> </DataTemplate> </dg:DataGridTemplateColumn.CellTemplate> </dg:DataGridTemplateColumn> How can I achieve this? Thanks.

    Read the article

  • [Cocoa] Core Animation with an NSView and subviews

    - by ndg
    I've subclassed NSView to create a 'container' view (which I've called TRTransitionView) which is being used to house two subviews. At the click of a button, I want to transition one subview out of the parent view and transition the other in, using the Core Animation transition type: kCATransitionPush. For the most part, I have this working as you'd expect (here's a basic test project I threw together). The issue I'm seeing relates to resizing my window and then toggling between my two views. After resizing a window, my subviews will appear at seemingly random locations within my TRTransitionView. Additionally, it appears as if the TRTransitionView hasn't stretched correctly and is clipping the contents of its subviews. Ideally, I would like subviews anchored to the top-left of their parent view at all times, and to also grow to expand the size of the parent view. The second issue relates to an NSTableView I've placed in my first subview. When my window is resized, and my TRTransitionView resizes to match its new dimensions, my TableView seems to resize its content quite awkwardly (the entire table seems to jolt around) and the newly expanded space that the table now occupies seems to 'flash' (as if in the process of being animated). Extremely difficult to describe, but is there any way to stop this? Here's my TRTransitionView class: -(void) awakeFromNib { [self setWantsLayer:YES]; [self addSubview:[self currentView]]; transition = [CATransition animation]; [transition setType:kCATransitionPush]; [transition setSubtype:kCATransitionFromLeft]; [self setAnimations: [NSDictionary dictionaryWithObject:transition forKey:@"subviews"]]; } - (void)setCurrentView:(NSView*)newView { if (!currentView) { currentView = newView; return; } [[self animator] replaceSubview:currentView with:newView]; currentView = newView; } -(IBAction) switchToViewOne:(id)sender { [transition setSubtype:kCATransitionFromLeft]; [self setCurrentView:viewOne]; } -(IBAction) switchToViewTwo:(id)sender { [transition setSubtype:kCATransitionFromRight]; [self setCurrentView:viewTwo]; }

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >