Search Results

Search found 324 results on 13 pages for 'scrollview'.

Page 10/13 | < Previous Page | 6 7 8 9 10 11 12 13  | Next Page >

  • TableVIew scrolling vertically

    - by senthilmuthu
    hi, i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?

    Read the article

  • iphone sdk: clickable image in UIWebView

    - by origon
    Hi. I wanna wrap some text around a UIButton or clickable image in some kind of scrollview. My ide was to add an UIButton to an UIWebView, but thats not possible? Is there a way to wrap text around an UIButton in an UIScrollView or UITextView? Or can I add an image to the UIWebView and handle the clicking somehow?

    Read the article

  • Prevent subview from scrolling in a UIScrollView

    - by jbrennan
    I have a UIScrollView subclass with a certain subview I'd like to prevent from scrolling (while all the other subviews scroll as normal). The closest example to this I can think of is UITableView's "index strip" on the right side (look in the Contacts app to see an example). I am guessing this is a subview of the table (scrollview) but it does not move as the user scrolls. I can't seem to make my subview stay put! How can I accomplish this?

    Read the article

  • List like iphone and HTC hero phone app

    - by user286919
    I want to create a list like iphone list and HTC hero phone app. So how can i do that because I tried it with default ListView but I can not make two list in a single layout and ScrollView does not work on it. So can any body help me about this matter?

    Read the article

  • 3 embedded UIScrollView problem

    - by Infinity
    Hello guys! I have 3 UIScrollView. Here is a sample code, about how they are added in eachother: UIScrollView main; UIScrollView page1; UIScrollView page2; UIScrollView doublePage; UIView pageContent1; UIView pageContent2; UIView doublePageContent; int nrPages = 1; sw2 = 0; main = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, 768, 980)]; main.contentSize = CGSizeMake(768 * (nrPages - 1 + sw2), 980); page1.frame = CGRectMake(0, 0, 768, 980); page2.frame = CGRectMake(768, 0, 768, 980); pageNumber = i - 1 + sw2; (i is a variable in a for loop) doublePage.frame = CGRectMake(768 * (pageNumber - 1), 0, 768 * 2, 980); CGFloat contentWidth = [page1 bounds].size.width + [page2 bounds].size.width; CGFloat contentHeight = page1 ? self.page1.bounds.size.height : self.page2.bounds.size.height; doublePageContent = [[UIView alloc] initWithFrame:CGRectMake(0, 0, contentWidth, contentHeight)]; [page1 addSubview:pageContent1]; [page2 addSubview:pageContent2]; [doublePageContent addSubview:page1]; [doublePageContent addSubview:page2]; [doublePage addSubview:doublePageContent]; [main addSubview:doublepage]; And with this structure the main scrollview don't want to scroll. Without the doublepage scrollview it is working good. What do you think? What's the problem? I know this structure is a little weird, but I need this structure because other parts of the code. Edited, added the information about the sizes. If you need something more please tell me. And one more thing.. If I add 1 pixel to the width of the doublePage contentSize.width it scrolls, but a bit hard, so it scrolls first in the doublePage and then in the main.

    Read the article

  • UIScrollView on scroll update method

    - by Alex Milde
    Hi is there a method / possibility to run a function when the scrollview is scrolling? i found scroll start and scroll end solutions but nothing like a onIsScrolling ... is there a built in solution? or whats the best workaround (nstimer)? thanks Alex

    Read the article

  • UIScrollView eating touches from its parent

    - by Jon Hull
    I have nested scrollViews (or rather a subclass of UIScrollView inside of an actual scrollview). I set the size of the inner view to its contentSize and set scrollEnabled = NO, because I only want the outside view scrolling. But the innerView occasionally eats touches and keeps the outerView from scrolling when it should. Is there something else I need to set to keep it from stealing the scrolling touches, but still allowing user interaction (e.g. editing a textView)?

    Read the article

  • Two TableVIew in ONE ViewCOntroller

    - by senthilmuthu
    hi, i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?

    Read the article

  • How to create a horizontal scrollable list?

    - by Thomas Joos
    hi all, I am wondering what the best approach is for creating a horizontal list with custom buttons. I read there is no native control for that: I am considering a UIView with a scroll view inside. On this scrollview I visualize my array of button objects. Any thoughts?

    Read the article

  • having trouble with zooming in android webview

    - by Talha
    I'm new to android. I'm using webview in scrollview to display my local html page (html has text only). I created two buttons for zoomin and zoomout using behind function zoomIn() & zoomOut() respectively. These functions work fine. The problenm is, when I zoom in, some of the text goes out from both top and bottom and it doesn't appear when I scroll. How can I resolve this?

    Read the article

  • i want to display this listview on scrolling

    - by Sasil
    I'm completely stumped on this one. I have three different lists that need to be displayed on the screen. I've tried using a ScrollView with a LinearLayout child, and putting my ListViews in the LinearView, but all of the ListViews lock to a fixed height with scroll bars. Using other kinds of Layouts means no scrolling.

    Read the article

  • Prevent delegate method from being called too often

    - by Lord Zsolt
    How would you add a delay between certain method being called? This is my code that I want to only trigger 30 times per second: - (void) scrollViewDidScroll: (UIScrollView*)scrollView { [self performSelector:@selector(needsDisplay) withObject:nil afterDelay:0.033]; } - (void) needsDisplay { [captureView setNeedsDisplay]; } If I leave it like this, it only gets called after the user stopped scrolling. What I want to do is call the method when the user is scrolling, but with a delay of 33 milliseconds between each call.

    Read the article

  • Animation not start immediately when the target view is out of window

    - by funnything
    Hi. When I apply some animation to the view, which is out of window, the animation not start immediately. And then, I scroll the screen to show the animation target view, the animation will start. I hope to the animation will start immediately when it apply. Any ideas? Bellow is sample code. Thank you. public class AnimationValidationActivity extends Activity { private ViewSwitcher _viewSwitcher; private Button _button; /** * utility method for animation */ private Animation buildTranslateAnimation( float fromXDelta , float toXDelta , float fromYDelta , float toYDelta ) { Animation ret = new TranslateAnimation( fromXDelta , toXDelta , fromYDelta , toYDelta ); ret.setDuration( 1000 ); return ret; } /** * build view in place of layout.xml */ private View buildView() { ScrollView ret = new ScrollView( this ); ret.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT ) ); LinearLayout parent = new LinearLayout( this ); parent.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT , LinearLayout.LayoutParams.WRAP_CONTENT ) ); parent.setOrientation( LinearLayout.VERTICAL ); ret.addView( parent ); _viewSwitcher = new ViewSwitcher( this ); _viewSwitcher.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT , 100 ) ); parent.addView( _viewSwitcher ); View spacer = new View( this ); spacer.setLayoutParams( new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT , getWindow() .getWindowManager().getDefaultDisplay().getHeight() ) ); parent.addView( spacer ); _button = new Button( this ); _button.setText( "button" ); parent.addView( _button ); return ret; } @Override public void onCreate( Bundle savedInstanceState ) { super.onCreate( savedInstanceState ); setContentView( buildView() ); _viewSwitcher.setFactory( new ViewSwitcher.ViewFactory() { @Override public View makeView() { TextView view = new TextView( AnimationValidationActivity.this ); view.setLayoutParams( new ViewSwitcher.LayoutParams( ViewSwitcher.LayoutParams.FILL_PARENT , ViewSwitcher.LayoutParams.FILL_PARENT ) ); view.setBackgroundColor( 0xffffffff ); view.setText( "foobar" ); return view; } } ); _button.setOnClickListener( new View.OnClickListener() { @Override public void onClick( View v ) { _viewSwitcher.setInAnimation( buildTranslateAnimation( _viewSwitcher.getWidth() , 0 , 0 , 0 ) ); _viewSwitcher.setOutAnimation( buildTranslateAnimation( 0 , - _viewSwitcher.getWidth() , 0 , 0 ) ); int color = new Random().nextInt(); _viewSwitcher.getNextView().setBackgroundColor( 0xff000000 | color & 0xffffff ); _viewSwitcher.showNext(); } } ); } }

    Read the article

  • [android]layout like printest

    - by Dcboy
    I want to make a custom view like pinterest in my code,i use scrollView and 3 linearlayout inside scrollview I custom my view name waterfallView here is the code: public class WaterfallView extends LinearLayout { private ListAdapter m_Adapter; private OnClickListener onClickListener = null; private LinearLayout m_Line1; private LinearLayout m_Line2; private LinearLayout m_Line3; public WaterfallView(Context context) { super(context); // TODO Auto-generated constructor stub InitLine(); } public WaterfallView(Context context, AttributeSet attrs) { super(context, attrs); InitLine(); } private void InitLine() { LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT); lp.weight = 1; // line2 m_Line1 = new LinearLayout(this.getContext()); m_Line1.setOrientation(VERTICAL); m_Line1.setLayoutParams(lp); // line2 m_Line2 = new LinearLayout(this.getContext()); m_Line2.setOrientation(VERTICAL); m_Line2.setLayoutParams(lp); // line3 m_Line3 = new LinearLayout(this.getContext()); m_Line3.setOrientation(VERTICAL); m_Line3.setLayoutParams(lp); addView(m_Line1); addView(m_Line2); addView(m_Line3); } public ListAdapter getAdapter() { return m_Adapter; } private void BindLayout() { int count = m_Adapter.getCount(); for (int i = 0; i < count; i++) { View v = m_Adapter.getView(i, null, null); v.setOnClickListener(this.onClickListener); if (i == 0 || i % 3 == 0) m_Line1.addView(v); if (i == 1 || i % 3 == 1) m_Line2.addView(v); if (i == 2 || i % 3 == 2) m_Line3.addView(v); } Log.v("countTAG", "" + count); } private void AddItem(){ } public void setAdapter(ListAdapter adapter) { this.m_Adapter = adapter; BindLayout(); } public OnClickListener getOnclickListner() { return onClickListener; } public void setOnclickLinstener(OnClickListener onClickListener) { this.onClickListener = onClickListener; } } In the BindLayout function there is m_Adapter.getView(i, null, null); then the second param convertView i would like to have AbsListView class using RecycleBin How could I do that?

    Read the article

  • Android: How to track down the origin of a InflateException?

    - by Janusz
    While starting my application I get the following warning in Logcat: 04-09 10:28:17.830: WARN/WindowManager(52): Exception when adding starting window 04-09 10:28:17.830: WARN/WindowManager(52): android.view.InflateException: Binary XML file line #24: Error inflating class <unknown> 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater.java:385) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2153) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2207) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1395) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.internal.policy.impl.PhoneWindowManager.addStartingWindow(PhoneWindowManager.java:818) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.server.WindowManagerService$H.handleMessage(WindowManagerService.java:8794) 04-09 10:28:17.830: WARN/WindowManager(52): at android.os.Handler.dispatchMessage(Handler.java:99) 04-09 10:28:17.830: WARN/WindowManager(52): at android.os.Looper.loop(Looper.java:123) 04-09 10:28:17.830: WARN/WindowManager(52): at com.android.server.WindowManagerService$WMThread.run(WindowManagerService.java:531) 04-09 10:28:17.830: WARN/WindowManager(52): Caused by: java.lang.reflect.InvocationTargetException 04-09 10:28:17.830: WARN/WindowManager(52): at android.widget.FrameLayout.<init>(FrameLayout.java:79) 04-09 10:28:17.830: WARN/WindowManager(52): at java.lang.reflect.Constructor.constructNative(Native Method) 04-09 10:28:17.830: WARN/WindowManager(52): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 04-09 10:28:17.830: WARN/WindowManager(52): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 04-09 10:28:17.830: WARN/WindowManager(52): ... 13 more 04-09 10:28:17.830: WARN/WindowManager(52): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x1010059 a=-1} 04-09 10:28:17.830: WARN/WindowManager(52): at android.content.res.Resources.loadDrawable(Resources.java:1677) 04-09 10:28:17.830: WARN/WindowManager(52): at android.content.res.TypedArray.getDrawable(TypedArray.java:548) 04-09 10:28:17.830: WARN/WindowManager(52): at android.widget.FrameLayout.<init>(FrameLayout.java:91) 04-09 10:28:17.830: WARN/WindowManager(52): ... 17 more My Application starts with the following splash screen: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:windowBackground="@color/white" android:background="@color/white" android:layout_width="fill_parent" android:layout_height="fill_parent" android:foregroundGravity="center"> <ImageView android:id="@+id/ImageView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:adjustViewBounds="true" android:scaleType="centerInside" android:src="@drawable/splash" android:layout_gravity="center" /> </ScrollView> Splash is the image that is shown in the splash screen. I have those four folders with for storing drawables in my app: /res/drawable-hdpi /res/drawable-ldpi /res/drawable-mdpi /res/drawable-nodpi the splash image has its own version in the first three of them and is displayed properly. Removing the src property from the ImageView removes the image but not the exception. I'm a little bit lost with where to look for the cause of the exception. I even don't know if this is really an issue in this layout file etc. How would you go about finding the cause for this warning?

    Read the article

  • Problem releasing UIImageView after adding to UIScrollView

    - by Josiah Jordan
    I'm having a memory problem related to UIImageView. After adding this view to my UIScrollView, if I try to release the UIImageView the application crashes. According to the stack trace, something is calling [UIImageView stopAnimating] after [UIImageView dealloc] is called. However, if I don't release the view the memory is never freed up, and I've confirmed that there remains an extra retain call on the view after deallocating...which causes my total allocations to climb quickly and eventually crash the app after loading the view multiple times. I'm not sure what I'm doing wrong here though...I don't know what is trying to access the UIImageView after it has been released. I've included the relevant header and implementation code below (I'm using the Three20 framework, if that has anything to do with it...also, AppScrollView is just a UIScrollView that forwards the touchesEnded event to the next responder): Header: @interface PhotoHiResPreviewController : TTViewController <UIScrollViewDelegate> { NSString* imageURL; UIImage* hiResImage; UIImageView* imageView; UIView* mainView; AppScrollView* mainScrollView; } @property (nonatomic, retain) NSString* imageURL; @property (nonatomic, retain) NSString* imageShortURL; @property (nonatomic, retain) UIImage* hiResImage; @property (nonatomic, retain) UIImageView* imageView; - (id)initWithImageURL:(NSString*)imageTTURL; Implementation: @implementation PhotoHiResPreviewController @synthesize imageURL, hiResImage, imageView; - (id)initWithImageURL:(NSString*)imageTTURL { if (self = [super init]) { hiResImage = nil; NSString *documentsDirectory = [NSString stringWithString:[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]]; [self setImageURL:[NSString stringWithFormat:@"%@/%@.jpg", documentsDirectory, imageTTURL]]; } return self; } - (void)loadView { [super loadView]; // Initialize the scroll view hiResImage = [UIImage imageWithContentsOfFile:self.imageURL]; CGSize photoSize = [hiResImage size]; mainScrollView = [[AppScrollView alloc] initWithFrame:[UIScreen mainScreen].bounds]; mainScrollView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); mainScrollView.backgroundColor = [UIColor blackColor]; mainScrollView.contentSize = photoSize; mainScrollView.contentMode = UIViewContentModeScaleAspectFit; mainScrollView.delegate = self; // Create the image view and add it to the scrollview. UIImageView *tempImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, photoSize.width, photoSize.height)]; tempImageView.contentMode = UIViewContentModeCenter; [tempImageView setImage:hiResImage]; self.imageView = tempImageView; [tempImageView release]; [mainScrollView addSubview:imageView]; // Configure zooming. CGSize screenSize = [[UIScreen mainScreen] bounds].size; CGFloat widthRatio = screenSize.width / photoSize.width; CGFloat heightRatio = screenSize.height / photoSize.height; CGFloat initialZoom = (widthRatio > heightRatio) ? heightRatio : widthRatio; mainScrollView.maximumZoomScale = 3.0; mainScrollView.minimumZoomScale = initialZoom; mainScrollView.zoomScale = initialZoom; mainScrollView.bouncesZoom = YES; mainView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; mainView.autoresizingMask = ( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); mainView.backgroundColor = [UIColor blackColor]; mainView.contentMode = UIViewContentModeScaleAspectFit; [mainView addSubview:mainScrollView]; // Add to view self.view = mainView; [imageView release]; [mainScrollView release]; [mainView release]; } - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return imageView; } - (void)dealloc { mainScrollView.delegate = nil; TT_RELEASE_SAFELY(imageURL); TT_RELEASE_SAFELY(hiResImage); [super dealloc]; } I'm not sure how to get around this. If I remove the call to [imageView release] at the end of the loadView method everything works fine...but I have massive allocations that quickly climb to a breaking point. If I DO release it, however, there's that [UIImageView stopAnimating] call that crashes the application after the view is deallocated. Thanks for any help! I've been banging my head against this one for days. :-P Cheers, Josiah

    Read the article

  • UIButtons in UIScrollView stop it scrolling, how to fix?

    - by Mark McFarlane
    Hi all, I have a problem with adding a set of UIButtons to a UIScrollView. With the buttons added it seems that the scroll command is not being passed to the scroll view as the buttons cover the whole surface. I've read various posts on this but still can't figure it out. I'm pretty new to iPhone programming so there's probably something obvious I've missed. I've tried things like canCancelContentTouches and delaysContentTouches to TRUE and FALSE. Here is the code I use to add the buttons to the scrollview. The scrollview was created in IB and is passed in to the function: -(void)drawCharacters:(NSMutableArray *)chars:(UIScrollView *)target_view { //NSLog(@"CLEARING PREVIOUS BUTTONS"); //clear previous buttons for parts/kanji if(target_view == viewParts){ for (UIButton *btn in parts_buttons) { [btn removeFromSuperview]; } [parts_buttons removeAllObjects]; } else if(target_view == viewKanji){ for (UIButton *btn in kanji_buttons) { [btn removeFromSuperview]; } [kanji_buttons removeAllObjects]; } //display options int chars_per_line = 9; //change this to change the number of chars displayed on each line if(target_view == viewKanji){ chars_per_line = 8; } int char_gap = 0; //change this to change the margin between chars int char_dimensions = (320/chars_per_line)-(char_gap*2); //set starting x, y coords int x = 0, y = 0; //increment y coord y += char_gap; //NSLog(@"ABOUT TO DRAW FIRST BUTTON"); for(NSMutableArray *char_arr in chars){ //increment x coord x += char_gap; //draw at x and y UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom]; myButton.frame = CGRectMake(x, y, char_dimensions, char_dimensions); // position in the parent view and set the size of the button [myButton setTitle:[char_arr objectAtIndex:0] forState:UIControlStateNormal]; [myButton setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal]; [myButton setTitleColor:[UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1.0] forState:UIControlStateDisabled]; myButton.titleLabel.font = [UIFont boldSystemFontOfSize:22]; if(target_view == viewKanji){ myButton.titleLabel.font = [UIFont boldSystemFontOfSize:30]; } // add targets and actions if(target_view == viewParts){ [myButton addTarget:self action:@selector(partSelected:) forControlEvents:UIControlEventTouchUpInside]; } else if(target_view == viewKanji){ [myButton addTarget:self action:@selector(kanjiSelected:) forControlEvents:UIControlEventTouchUpInside]; [myButton setTag:(int)[char_arr objectAtIndex:1]]; } //if the part isnt in the current list of kanji, disable and dim it if(target_view == viewParts){ if([kanji count] > 0){ [myButton setEnabled:NO]; } bool do_break = NO; for(NSMutableArray *arr in kanji){ //NSLog([NSString stringWithFormat:@"CHECKING PARTS AGAINST %d KANJI", [kanji count]]); for(NSString *str in [[arr objectAtIndex:2] componentsSeparatedByString:@" "]){ if(([myButton.titleLabel.text isEqualToString:str])){ //NSLog(@"--------------MATCH!!!-----------------"); [myButton setEnabled:YES]; for(NSString *str1 in parts_selected){ if(([myButton.titleLabel.text isEqualToString:str1])){ [myButton setEnabled:NO]; break; } } do_break = YES; break; } if(do_break) break; } if(do_break) break; } } // add to a view [target_view addSubview:myButton]; //update coords of next button x += char_dimensions+ char_gap; if (x > (320-char_dimensions)) { x = 0; y += char_dimensions + (char_gap*2); } //add button to global array to be removed from view next update if(target_view == viewParts){ [parts_buttons addObject:myButton]; } else if(target_view == viewKanji){ [kanji_buttons addObject:myButton]; } } //NSLog(@"FINISHED DRAWING ALL BUTTONS"); } Any help on this would be greatly appreciated. I just need to fix this to finish my app.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13  | Next Page >