Search Results

Search found 1557 results on 63 pages for 'horizontal'.

Page 33/63 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • marquee text view in android

    - by raqz
    i tried various combinations as answered here in SO...but i am still not able to get the text to marquee... combination 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/organizationText" android:layout_height="38px" android:gravity="center_horizontal" android:textColor="#0099CC" android:layout_gravity="center" android:textSize="08pt" android:layout_width="wrap_content" android:maxLines="1" android:ellipsize="marquee" android:fadingEdge="horizontal" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:focusable="true" android:focusableInTouchMode="true" /> </RelativeLayout> orgText.setSelected(true); orgText.setEllipsize(TruncateAt.MARQUEE); orgText.setText(organization); I tried without using setSelected but it still doesnt work. any help would be appreciated... also, this entire view is a part of Linear layout.

    Read the article

  • WPF Show Open TabItem Names in a List View

    - by mr justinator
    I'm trying to display a list of open tab names in a listview or listbox (recommendations?). Been going through the different type of binding options and I'm able to bind to a single tab name but it displays vertical instead of horizontal. Here is my XAML: <ListView DockPanel.Dock="Left" Height="352" Name="listView1" Width="132" ItemsSource="{Binding ElementName=RulesTab, Path=Name}" IsSynchronizedWithCurrentItem="True" FlowDirection="LeftToRight" HorizontalAlignment="Left" HorizontalContentAlignment="Left" DataContext="{Binding}"> Any pointers would be greatly appreciated as I'd like to be able to see a list of all the tabs open and then double click on one to bring the tab into focus. Many thanks!

    Read the article

  • PowerBuilder Indeterminate Progress Bar

    - by Adam Hawkes
    I have a somewhat-long-running stored procedure being called from a PB application. I want the UI to show an indicator that it is processing, but I don't know the exact progress. That is, I can't say whether it is 10% or 90% done. All I know is when it is done. To give the user something to look at I'd like to put a "Inderterminate" (horizontal) progress bar on the window somewhere. I've looked at the documentation for the built-in HProgressBar control and don't see how to force this behavior. Short of writing my own control or importing another one, is there a way to accomplish this?

    Read the article

  • Fast block placement algorithm, advice needed?

    - by James Morris
    I need to emulate the window placement strategy of the Fluxbox window manager. As a rough guide, visualize randomly sized windows filling up the screen one at a time, where the rough size of each results in an average of 80 windows on screen without any window overlapping another. It is important to note that windows will close and the space that closed windows previously occupied becomes available once more for the placement of new windows. The window placement strategy has three binary options: Windows build horizontal rows or vertical columns (potentially) Windows are placed from left to right or right to left Windows are placed from top to bottom or bottom to top Why is the algorithm a problem? It needs to operate to the deadlines of a real time thread in an audio application. At this moment I am only concerned with getting a fast algorithm, don't concern yourself over the implications of real time threads and all the hurdles in programming that that brings. So far I have two choices which I have built loose prototypes for: 1) A port of the Fluxbox placement algorithm into my code. The problem with this is, the client (my program) gets kicked out of the audio server (JACK) when I try placing the worst case scenario of 256 blocks using the algorithm. This algorithm performs over 14000 full (linear) scans of the list of blocks already placed when placing the 256th window. 2) My alternative approach. Only partially implemented, this approach uses a data structure for each area of rectangular free unused space (the list of windows can be entirely separate, and is not required for testing of this algorithm). The data structure acts as a node in a doubly linked list (with sorted insertion), as well as containing the coordinates of the top-left corner, and the width and height. Furthermore, each block data structure also contains four links which connect to each immediately adjacent (touching) block on each of the four sides. IMPORTANT RULE: Each block may only touch with one block per side. The problem with this approach is, it's very complex. I have implemented the straightforward cases where 1) space is removed from one corner of a block, 2) splitting neighbouring blocks so that the IMPORTANT RULE is adhered to. The less straightforward case, where the space to be removed can only be found within a column or row of boxes, is only partially implemented - if one of the blocks to be removed is an exact fit for width (ie column) or height (ie row) then problems occur. And don't even mention the fact this only checks columns one box wide, and rows one box tall. I've implemented this algorithm in C - the language I am using for this project (I've not used C++ for a few years and am uncomfortable using it after having focused all my attention to C development, it's a hobby). The implementation is 700+ lines of code (including plenty of blank lines, brace lines, comments etc). The implementation only works for the horizontal-rows + left-right + top-bottom placement strategy. So I've either got to add some way of making this +700 lines of code work for the other 7 placement strategy options, or I'm going to have to duplicate those +700 lines of code for the other seven options. Neither of these is attractive, the first, because the existing code is complex enough, the second, because of bloat. The algorithm is not even at a stage where I can use it in the real time worst case scenario, because of missing functionality, so I still don't know if it actually performs better or worse than the first approach. What else is there? I've skimmed over and discounted: Bin Packing algorithms: their emphasis on optimal fit does not match the requirements of this algorithm. Recursive Bisection Placement algorithms: sounds promising, but these are for circuit design. Their emphasis is optimal wire length. Both of these, especially the latter, all elements to be placed/packs are known before the algorithm begins. I need an algorithm which works accumulatively with what it is given to do when it is told to do it. What are your thoughts on this? How would you approach it? What other algorithms should I look at? Or even what concepts should I research seeing as I've not studied computer science/software engineering? Please ask questions in comments if further information is needed. [edit] If it makes any difference, the units for the coordinates will not be pixels. The units are unimportant, but the grid where windows/blocks/whatever can be placed will be 127 x 127 units.

    Read the article

  • c# winforms - scrollable panel with rectangles

    - by Peanut
    Hi, I'm new to winforms and have tried to track down an answer to the following with no luck ... I have a panel in winforms and add to it a Rectangle that is wider than the panel itself. I've set the panel AutoScroll property to true however the panels horizontal scrollbar never appears. Why is this? And how do I get the scrollbar to scroll? Here is my code to add the rectangle: private void panel1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle rec = new Rectangle(2, 2, 400, 40); g.DrawRectangle(new Pen(Color.Black), rec); g.FillRectangle(new SolidBrush(Color.Blue), rec); } If I add a Label control to the panel and give it a text value that will go beyond the bounds of the panel - then the autoscroll works, but just not for a rectangle. Many thanks.

    Read the article

  • PHP Include Windows XP Notepad++ Editor - Nav Include Not Working - Nav Disappears

    - by Lorianna Sprague
    I am creating a website, and have a tabbed horizontal menu. In order to cut back on the number of files I have to edit when I have to make changes to the menu I want to put the navigation in a separate file that I can call using a PHP include statement. When I do this, however, the nav disappears entirely from the page. The rest of the content remains, and there are no error messages. I have been looking for answers for this for weeks, and have tried every version of the PHP include statement that I could find. None of them worked. This was the last attempt. I have the file "nav.php" in a folder named "includes" in a main dir called "testsite" I use Windows XP, use NotePad++ as my text editor, and have been testing in Firefox. I can't find an answer anywhere - any help would be appreciated. Lorianna

    Read the article

  • Text orientation

    - by Psytronic
    Hi Guys I know you can do this to get vertical text in a tab header: <Window x:Class="Abodemploy.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" <Grid <TabControl Margin="0" Name="tabControl1" FlowDirection="LeftToRight" TabStripPlacement="Left" <TabItem <TabItem.Header <StackPanel Orientation="Horizontal" <TextBlockHomes</TextBlock </StackPanel </TabItem.Header <TabItem.LayoutTransform <TransformGroup <RotateTransform Angle="90" / </TransformGroup </TabItem.LayoutTransform <Grid / </TabItem </TabControl </Grid </Window However the text letters are sideways. What I'd like (if possible) is for the letter orientation to be correct (ie upwards), but the text flow downwards, is this possible, or am I just dreaming the impossible dream? Thanks Psy

    Read the article

  • [WPF]ItemsControl not completely loaded @Loaded event

    - by Kaare
    Hi everyone I have a propably simple problem, that i just can't seem to figure out: I've made an ItemsControl which has its datacontext set and shows the data as pairs of Checkboxes and TextBlocs: <ItemsControl Name="listTaskTypes" Grid.Row="1" Grid.Column="2" Grid.RowSpan="2" ItemsSource="{Binding}" Margin="10,0,0,0" VerticalAlignment="Top" Loaded="listTaskTypes_Loaded"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox Name="checkBoxTypeId" Tag="{Binding Path=TaskTypeID}"/> <TextBlock FontSize="11pt" FontFamily="Helvetica" Text="{Binding Path=Text}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> My problem is that in the Loaded event of the ItemsControl, the checkboxes does not exist yet. How can i get an event when the ItemsControl is completely loaded or is this not possible?

    Read the article

  • WPF Validation & IDataErrorInfo

    - by Jefim
    A note - the classes I have are EntityObject classes! I have the following class: public class Foo { public Bar Bar { get; set; } } public class Bar : IDataErrorInfo { public string Name { get; set; } #region IDataErrorInfo Members string IDataErrorInfo.Error { get { return null; } } string IDataErrorInfo.this[string columnName] { get { if (columnName == "Name") { return "Hello error!"; } Console.WriteLine("Validate: " + columnName); return null; } } #endregion } XAML goes as follows: <StackPanel Orientation="Horizontal" DataContext="{Binding Foo.Bar}"> <TextBox Text="{Binding Path=Name, ValidatesOnDataErrors=true}"/> </StackPanel> I put a breakpoint and a Console.Writeline on the validation there - I get no breaks. The validation is not executed. Can anybody just press me against the place where my error lies?

    Read the article

  • Graphviz DOT arange Nodes in circles

    - by Ivo Wetzel
    OK here's my problem, I'm generating a graph of a python module, including all the files with their functions/methods/classes. I want to arrange it so, that nodes gather in circles around their parent nodes, currently everything is on one gargantuan horizontal row, which makes the thing 50k pixels wide and also let's the svg converter fail(only renders about the half of the graph). I went trough the docs(http://www.graphviz.org/doc/info/attrs.html) but couldn't find anything that seems to do the trick. So the question is: Is there a simple way to do this or do I have to layout the whole thing by myself? :/

    Read the article

  • How to style an asp.net menu with CSS

    - by md1337
    I'm in the process of styling an asp.net menu and I'm trying to understand the meaning of the StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass parameters. My understanding is that the styles defined with these parameters are applied as CSS classes to the relevant elements, whenever needed. So I created my menu as follows: <asp:Menu ID="NavigationMenu" DataSourceID="NavigationSiteMapDataSource" StaticMenuStyle-CssClass="StaticMenuStyle" StaticMenuItemStyle-CssClass="StaticMenuItemStyle" StaticSelectedStyle-CssClass="StaticSelectedStyle" StaticHoverStyle-CssClass="StaticHoverStyle" Orientation="Horizontal" MaximumDynamicDisplayLevels="0" runat="server"> </asp:Menu> It works for StaticMenuStyle-CssClass and StaticMenuStyle-CssClass (the classes are applied to the relevant elements), but StaticSelectedStyle-CssClass and StaticHoverStyle-CssClass are not applied, regardless of the selected or hover status of an element. What am I supposed to do to make this work? Thanks.

    Read the article

  • Displaying the selected item differently in ComboBox

    - by David Brunelle
    I have a combo box in which I set up an ItemTemplate that looks something like this: <ComboBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Piece.NoPiece}" Width="50" /> <TextBlock Text="{Binding Piece.Description}" Width="170" /> <TextBlock Text="{Binding Piece.Categorie.NomCategorie}" /> </StackPanel> </DataTemplate> </ComboBox.ItemTemplate> As you can see, I got three columns that let the user see different piece of information. However, I would like the selected item in the combo to display only the second column. In other word, is there a way to have an ItemTemplate that displays items in a different manner when you scroll down versus when it's closed and you only see the selection?

    Read the article

  • Hiding flash component scrollbars using object/param syntax

    - by Kieran Benton
    Hi all, I'm not sure if this is possible (complete non-flash developer speaking), but we have a 3rd party component that we want to only show a certain topleft hand portion of. I've tried limiting the size of the HTML object container as: <object type="application/x-shockwave-flash" width="600" height="415" data="<url>"> <param name="movie" value="<url>" /> <param name="wmode" value="transparent" /> <param name="allowscriptaccess" value="always" /> <param name="quality" value="high" /> <param name="flashvars" value="<vars>" /> </object> So limiting it to 600x415, but this causes horizontal and vertical scrollbars as part of the flash component to appear. Is there any standard way to override this behaviour? Thanks.

    Read the article

  • Synchronizing scroll positions for 2 WPF DataGrids

    - by Philipp Schmid
    I am trying to synchronize the horizontal scroll position of 2 WPF DataGrid controls. I am subscribing to the ScrollChanged event of the first DataGrid: <toolkit:DataGrid x:Name="SourceGrid" ScrollViewer.ScrollChanged="SourceGrid_ScrollChanged"> I have a second DataGrid: <toolkit:DataGrid x:Name="TargetGrid"> In the event handler I was attempting to use the IScrollInfo.SetHorizontalOffset, but alas, DataGrid doesn't expose IScrollInfo: private void SourceGrid_ScrollChanged(object sender, ScrollChangedEventArgs e) { ((IScrollInfo)TargetGrid).SetHorizontalOffset(e.HorizontalOffset); // cast to IScrollInfo fails } Is there another way to accomplish this? Or is there another element on TargetGrid that exposes the necessary IScrollInfo to achieve the synchronization of the scroll positions? BTW, I am using frozen columns, so I cannot wrap both DataGrid controls with ScrollViewers.

    Read the article

  • How to implement drag and drop in Flex Grid control?

    - by Bogdan
    I have a simple Grid control with some buttons that I want to be able to move around. The code below does work, but it takes a lot of effort to actually do the drag&drop and it is not clear where the drop will happen. I have to move the mouse around a lot to get to a state where the drop is not rejected. I would appreciate any suggestions on how to make this more "user friendly". <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" horizontalAlign="center" height="200" width="200"> <mx:Script> <![CDATA[ import mx.containers.GridItem; import mx.controls.Button; import mx.core.DragSource; import mx.events.*; import mx.managers.DragManager; private function dragInit(event:MouseEvent):void { if(event.buttonDown) { var button:Button = event.currentTarget as Button; var dragSource:DragSource = new DragSource(); dragSource.addData(button, 'button'); DragManager.doDrag(button, dragSource, event); } } private function dragEnter(event:DragEvent): void { var target:GridItem = event.currentTarget as GridItem; if (event.dragSource.hasFormat('button') && target.getChildren().length == 0) { DragManager.acceptDragDrop(target); DragManager.showFeedback(DragManager.MOVE); } } private function dragDrop(event:DragEvent): void { var target:GridItem = event.currentTarget as GridItem; var button:Button = event.dragSource.dataForFormat('button') as Button; target.addChild(button); } ]]> </mx:Script> <mx:Grid> <mx:GridRow width="100%" height="100%"> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> <mx:Button label="A" width="40" height="40" mouseMove="dragInit(event)"/> </mx:GridItem> </mx:GridRow> <mx:GridRow width="100%" height="100%"> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> <mx:Button label="B" width="40" height="40" mouseMove="dragInit(event)"/> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> </mx:GridRow> <mx:GridRow width="100%" height="100%"> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> <mx:Button label="C" width="40" height="40" mouseMove="dragInit(event)"/> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> <mx:GridItem width="44" height="44" dragEnter="dragEnter(event)" dragDrop="dragDrop(event)"> </mx:GridItem> </mx:GridRow> </mx:Grid> <mx:Style> GridItem { borderColor: #A09999; borderStyle: solid; borderThickness: 2; horizontal-align: center; vertical-align: center; } Grid { borderColor: #A09999; borderStyle: solid; borderThickness: 2; horizontalGap: 0; verticalGap: 0; horizontal-align: center; vertical-align: center; } </mx:Style> </mx:Application>

    Read the article

  • WPF: Aligning the base line of a Label and its TextBox

    - by Heinzi
    Let's say I have a simple TextBox next to a Label: <StackPanel> <StackPanel Orientation="Horizontal"> <Label Margin="3">MyLabel</Label> <TextBox Margin="3" Width="100">MyText</TextBox> </StackPanel> ... </StackPanel> This yields the following result: As you can see, the base lines of MyLabel and MyText are not aligned, which looks ugly. Of course, I could start playing around with the margins until they match up, but since this is such a common requirement I'm sure that WPF provides a much easier and more elegant solution, which I just haven't found yet...

    Read the article

  • Cannot format first column in WxPython's ListCtrl

    - by Matt Clarke
    If I set the format of the first column in a ListCtrl to align centre (or align right) nothing happens. It works for the other columns. This only happens on Windows - I have tested it on Linux and it works fine. Does anyone know if there is a work-round or other solution? Here is an example based on code found at http://zetcode.com/wxpython/ import wx import sys packages = [('jessica alba', 'pomona', '1981'), ('sigourney weaver', 'new york', '1949'), ('angelina jolie', 'los angeles', '1975'), ('natalie portman', 'jerusalem', '1981'), ('rachel weiss', 'london', '1971'), ('scarlett johansson', 'new york', '1984' )] class Actresses(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(380, 230)) hbox = wx.BoxSizer(wx.HORIZONTAL) panel = wx.Panel(self, -1) self.list = wx.ListCtrl(panel, -1, style=wx.LC_REPORT) self.list.InsertColumn(0, 'name', wx.LIST_FORMAT_CENTRE,width=140) self.list.InsertColumn(1, 'place', wx.LIST_FORMAT_CENTRE,width=130) self.list.InsertColumn(2, 'year', wx.LIST_FORMAT_CENTRE, 90) for i in packages: index = self.list.InsertStringItem(sys.maxint, i[0]) self.list.SetStringItem(index, 1, i[1]) self.list.SetStringItem(index, 2, i[2]) hbox.Add(self.list, 1, wx.EXPAND) panel.SetSizer(hbox) self.Centre() self.Show(True) app = wx.App() Actresses(None, -1, 'actresses') app.MainLoop()

    Read the article

  • How to have ListView items with Label show up at the bottom of the item not to the right in WPF?

    - by Joan Venge
    I am using a WrapPanel with an Image and Label, but the Label shows up to the right of the item. How can I make it show up at the bottom of the Image/Item? <Window.Resources> <DataTemplate x:Key="ItemTemplate"> <WrapPanel Orientation="Horizontal"> <Image Width="50" Height="50" Stretch="Fill" Source="{Binding Cover}"/> <Label Content="{Binding Title}" /> </WrapPanel> </DataTemplate> </Window.Resources>

    Read the article

  • Aligning data in a table

    - by Hulk
    In the following table, how do I align the data in td cells such that we do not get a horizontal scroll bar, using CSS? <table> <tr><th>name</th> <th>info</th></tr> <tr><td>Harry</td> <td>suminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfosuminfo<td></tr> <tr><td>test</td><td>test data</td></tr> </table>

    Read the article

  • Mobile iPhone - Multiple buttons in a row

    - by Thomas
    Hello all: I'm an iPhone developer, but new to web development. I've done some basic HTML websites and made one in iWeb as well. I'm trying to branch out to actual mobile development now, so I checked out Dashcode. Anyway, I'm trying to put a Call Button, Mail Button, and Map Button in horizontal alignment. I realize that I can add a Column Layout and have two buttons in a row, but that's the most I've gotten. Any ideas? Thanks! Thomas

    Read the article

  • In a digital photo, detecting if a mountain is obscured by clouds.

    - by Gavin Brock
    The problem I have a collection of digital photos of a mountain in Japan. However the mountain is often obscured by clouds or fog. What techniques can I use to detect that the mountain is visible in the image? I am currently using Perl with the Imager module, but open to alternatives. All the images are taken from the exact same position - these are some samples. My naïve solution I started by taking several horizontal pixel samples of the mountain cone and comparing the brightness values to other samples from the sky. This worked well for differentiating good image 1 and bad image 2. However in the autumn it snowed and the mountain became brighter than the sky, like image 3, and my simple brightness test started to fail. Image 4 is an example of an edge case. I would classify this as a good image since some of the mountain is clearly visible.

    Read the article

  • How to implement JQuery easing into this window scroll movement function?

    - by Mohammad
    With this code I've been able to capture the mousewheel movement and apply it to the horizontal scroll bars instead of the vertical default. $('html').bind('mousewheel', function(event, delta) { window.parent.scrollBy(-120 * delta, 0); return false; }); Is there any way that I could add this jQuery easing animation to the scroll movement? jQuery.extend( jQuery.easing, { easeInOutBack: function (x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; } }); Thank you so much in advance!

    Read the article

  • Possible to Freeze Columns in a WPF ListView/GridView?

    - by Phil Sandler
    I currently have a GridView inside a ListView.View. The GridView columns will far exceed the width of the screen, so there will always be horizontal scrolling. What I would like to do is to have certain columns always remain on the screen regardless of scrolling. So the first x columns from the left are frozen (ala Excel), and the rest can scroll. It does not need to be dynamic/user selected--I know in advance which columns need to be frozen. Is this possible?

    Read the article

  • How to draw diagonal table borders in latex, like in excel ?

    - by Amyn Bennamane
    Is it possible to draw diagonal (parallelogram) cells in LaTeX: the cell content is diagonal, and the cell's originally vertical borders are also diagonal. Here is what I managed to do using the rotating package: \begin{tabular}{|r|c|c|} \hline \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ & \begin{rotate}{45}Trying to save some horizontal space\end{rotate} & \begin{rotate}{45}While keeping headers readable\end{rotate} \\ \hline this & is & a \\ \hline sample & latex & table \\ \hline \end{tabular} Here is a screenshot of the output vs what is possible using excel: Thanks.

    Read the article

  • iphone sdk: finding the direction of scrolling in UIScrollView

    - by Alex1987
    I have a UIScrollView with only horizontal scrolling allowed, and I would like to know which direction (left, right) the user scrolls. What I did was to subclass the UIScrollView and override the touchesMoved method: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesMoved:touches withEvent:event]; UITouch *touch = [touches anyObject]; float now = [touch locationInView:self].x; float before = [touch previousLocationInView:self].x; NSLog(@"%f %f", before, now); if (now > before){ right = NO; NSLog(@"LEFT"); } else{ right = YES; NSLog(@"RIGHT"); } } But this method sometimes doesn't get called at all when I move. What do you think?

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >