What makes scrolling so choppy on the UITableView when images are loaded? Is it because they need to be added as subviews? Or is it because images need to be cached? Both?
I have a table view in which if each cell is touched video plays. Each cell have image of the video cell.imageView.image. And on the image I have a button (UIButton) with play symbol.
If I touch the play button the corresponding video should be played same like the when cell is touched.
I have a selector for the play button. How can I relate the corresponding cell to the play button.
Thank You.
hi any one know iphone uislider with two thumbsindicators, i have tried to manipulate it, any one have idea means please guide me. Am new to iphone development please help me.
thanks in advance
Hi,
I have this code:
CGPoint arrowMiddle = CGPointMake((arrowOne.x + arrowTo.x)/2, (arrowOne.y + arrowTo.y)/2);
CGPoint arrowLeft = CGPointMake(arrowMiddle.x-40, arrowMiddle.y);
CGPoint arrowRight = CGPointMake(arrowMiddle.x, arrowMiddle.y + 40);
[arrowPath addLineToScreenPoint:arrowLeft];
[arrowPath addLineToScreenPoint:arrowMiddle];
[arrowPath addLineToScreenPoint:arrowRight];
[[mapContents overlay] addSublayer:arrowPath];
[arrowPath release];
with this output:
http://yfrog.com/edschermafbeelding2010032p
What have i to add to get the left and right the at same degree of the line + 30°.
If someone has the algorithm of drawing an arrow on a line, pleas give it. It doesn't matter what programming language it is...
Thanks
I want to resize my table view cells from inside the cell instead of from the UITableViewDelegate. I am resizing them based on asynchronous content, so I can't size them in the delegate.
I tried setting self.frame inside the cell, but the table view was really unhappy about that. Cells were overlapping and all kinds of craziness was going on.
I've been looking at the Stanford University iphone videos on iTunes U. And saw the teacher trying to do something similar to this code but he realised and said it didn't work though I didn't get why:
- (IBAction)flashPressed{
if (window.backgroundColor == [UIColor magentaColor]){
window.backgroundColor = [UIColor redColor];
}else {
window.backgroundColor = [UIColor magentaColor];
}
}
Objective-C, windows based application. Not sure what else you need to know.
Hi,
I'm a new user to this interesting forum!
I want start developing an application for android and before starting i want learn about some android features...
The first android feature is how to correlate finger motion on the screen with java...
Are there any source code examples that show how to draw with your finger on an android screen?
Can you suggest a good place for me to download an example?
thanks
how does one use code to do this:
produce 15 random numbers that are not in any order, and that only occur once
eg.
1 4, 2, 5, 3, 6, 8, 7, 9, 10, 13, 12, 15, 14, 11
rand() or arc4rand() can repeat some, which is not what im after.
Thanks
Simply, I have placed an image with the Interface Builder in a UIView. Now I want to run a method/function when I am touching that image, for example when another image should be loaded.
My Code:
- (void)touchesended:(NSSet*) touches withEvent:(UIEvent *)event {
// UITouch *touch = [touch anyObject];
bild_1_1.image = [UIImage imageNamed:@"t_1_4.jpg"];
//}
}
Hi,
ive configured local service under some app.
i wanna know how could i invoke methods on the activity, through the service in a synchronous way for example:
the service invoke a method inthe activity and waiting for for result(synchronous) from it.
(the method exists in the activity)
thanks.
I'm looking to choose a namespace for a library I'm writing and I'd like to avoid conflicts with other namespaces.
Does anyone know of a website that lists all of the class prefixes in use?
I have UITableView. I customized the cell height (increased).
I have 4 labels(UILabel) and 1 image(UIImage) and 3 buttons (UIButton). one of the button is delete button. By touching the cell or button(play button) on the image a video is loaded and played.
I need to delete the cell by touching delete button. If I touched the delete button the corresponding video is deleted from library . But, how to delete the cell and all remaining data in it ? I am not able to delete the cells or the data in the cells.
How to do it ?
Thank you.
I have a UIToolBar *toolbar1. I have 3 buttons on the toolbar. And the tool bar is at the bottom of the view.
The buttons are like library button, moreApps button, recordVideo button. If I touch the library button a new view(a UITableViewController) appears. I used presentModelViewController for it. If I touch moreApps button a new view (a UIViewController) appears and it loaded from http//. The recordButton touch gives another UIViewController view.
When the moreApps button is touched and the view is loaded, it have the content from web and a UIToolBar *toolbar2 at the bottom the view. It has a refresh button and done button.
The problem is when I touch the toolbar2 (not on the refresh button and done button) the previous views button are activated and corresponding views of previous buttons(library button, playVideo button) are loaded. I am not able to understand about this problem.
Thank you.
Hello,
In my app I move the table view (in order to make the text fields visible when the keyboard appears). The view is looks following:
This is the code I use for resizing the view and moving it up:
static const NSUInteger navBarHeight = 44;
CGRect appFrame = [[UIScreen mainScreen] applicationFrame];
tableView.frame = CGRectMake(0, navBarHeight, appFrame.size.width, appFrame.size.height-navBarHeight-216); //216 for the keyboard
NSIndexPath *indPath = [self getIndexPathForTextField:textField]; //get the field the view should scroll to
[tableView scrollToRowAtIndexPath:indPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
The problem is that when the view is moved up it also moves 3 pixels into right direction (it is hard to see the difference in the screenshot, but it is visible when the animation is on and I measured the difference with PixelStick tool). Here it is how it looks after the move:
My analysis shows that scrolling the table does not influence the move to the right.
Any ideas what is wrong in the code above that makes the view move to the right?
I am looking for ideas as to how all of you can think to solve this issue. I am going to be using an Android Tablet as basically a touch screen input for a project. I need to be able to control servos and solenoids and such, so I will be using a Raspberry Pi to do this. I am looking for ideas on how to get the tablet and the Raspberry Pi to talk. Here are a few that I have though of so far.
Use Wifi (which I really do not want to, Ethernet would be okay) to ssh into the Raspberry Pi (with an external library) and run scripts that way from the Android app.
Use a com port for Android (maybe Andropod if there hardware becomes available?) and run scripts on the Raspberry Pi.
Those are probably two of the "best" ideas that I can think of for now.
Can anyone think of any other "better" ideas?
Thanks in advance for the help,
Dan
I've been using this method for a few weeks now as suggested on my previous question and the app now keeps crashing with a Protocol 443 error - something about unable to resolve the address.
Worked fine when first installed and then just stopped. The same with on the device itself, worked fine until this morning and now the same issue?? Nothing wrong with the URL as I can still load in a browser.
If I leave it for a couple of days it starts working again?? Is there a more effecient way of using the Http POST and GET functions? All I am trying to do is perform a login and save the resulting page to a string.
Is there a more Android friendly way?
I've read this post about mocking location with custom provider, but I am looking for a way to mock the location during a presentation, is that possible?
I want to add an image using the cell.imageView setImage: method. However, depending on field from an array (in the form of an NSString and called using [dog types]) I need the image to change to an image which reflects the type of dog.
How do I go about doing this? Thanks.
Hi everyone,
I currently have a very simple view which displays info from a JSON feed. The problem I'm facing is the few second pause I encounter once I press this tab. How can I make this view load instantly and then have the label.text areas load after? Preferable with an activity indicator?
Should I use threads?
Thanks in advance!
Code:
- (NSString *)stringWithUrl:(NSURL *)url {
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:30];
NSData *urlData;
NSURLResponse *response;
NSError *error;
urlData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&response error:&error];
return [[NSString alloc] initWithData:urlData encoding:NSUTF8StringEncoding];
}
- (id)objectWithUrl:(NSURL *)url {
SBJsonParser *jsonParser = [SBJsonParser new];
NSString *jsonString = [self stringWithUrl:url];
return [jsonParser objectWithString:jsonString error:NULL];
}
- (NSDictionary *)downloadStats {
id response = [self objectWithUrl:[NSURL URLWithString:@"http://www.example.com/JSON"]];
NSDictionary *feed = (NSDictionary *)response;
return feed;
[feed release];
}
- (void)viewDidLoad {
[super viewDidLoad];
[GlobalStatsScrollView setScrollEnabled:YES];
[GlobalStatsScrollView setContentSize:CGSizeMake(320, 360)];
}
- (void)viewWillAppear:(BOOL)animated {
NSLog(@"View appears");
// Download JSON Feed
NSDictionary *feed = [self downloadStats];
totalproduced.text = [feed valueForKey:@"Produced"];
totalno.text = [feed valueForKey:@"Total"];
mostcommon.text = [feed valueForKey:@"Most Common"];
}