uiimageview

How to convert a base64 encoded document into a multipage UIImageView in iOS?

泪湿孤枕 提交于 2019-12-13 01:45:31
问题 The examples I have seen are geared towards C#. Any tips would be appreciated. 回答1: UIImage* image = [UIImage imageWithData: [NSData dataFromBase64EncodedString: stringBase64]]; Hope it helps. I don't know what you mean by "multipage UIImageView". The NSData category providing the dataFromBase64EncodedString method is here or here. 来源: https://stackoverflow.com/questions/5890305/how-to-convert-a-base64-encoded-document-into-a-multipage-uiimageview-in-ios

Swift 3/4 How to animate contentMode of UIImageView

南笙酒味 提交于 2019-12-13 01:28:46
问题 My goal is when I click on button to toggle contentMode: scaleAspectFit & scaleAspectFill with animation. @IBAction func toggleContentModeAction(_ sender: UIButton) { sender.isSelected = !sender.isSelected if sender.isSelected { UIView.animate(withDuration: 0.3) { self.popImageView.contentMode = .scaleAspectFit self.view.layoutIfNeeded() } }else { UIView.animate(withDuration: 0.3) { self.popImageView.contentMode = .scaleAspectFill self.view.layoutIfNeeded() } } } but no effective to my goal.

Swift, Constraint, The view hierarchy is not prepared for the constraint

痴心易碎 提交于 2019-12-13 01:14:31
问题 I'm trying to add an image inside the navigation constroller and center it. So I do have an imageView and a UINavigationBar and I want to add the image view to that navigation bar and center it horizontally. The UINavigationBar comes from the UINavigationController . I keep getting the following error: The view hierarchy is not prepared for the constraint: When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint

ios awkard image loading (url to nsdata to uiimage to uiimageview)

女生的网名这么多〃 提交于 2019-12-13 00:12:53
问题 I need you to humor me during this question. This is somewhat pseudo code because the actual situation is quite complex. I wouldn't load an image this way unless I needed to. Assume that I need to. NSURL *bgImageURL = [NSURL URLWithString:@"https://www.google.com/images/srpr/logo3w.png"]; UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:bgImageURL]]; [self.anIBOutletOfUIImageView setImage:img]; but I crash out with -[__NSCFData _isResizable]: unrecognized selector sent to

Getting Image Names of GridView Items

£可爱£侵袭症+ 提交于 2019-12-12 23:16:57
问题 I have a gridview which I am inflating in a Dialog view. Now when I open the dialog ( with Grid View ) it shows a set of 10 images. when dialog is dismissed the image which I selected is set on the ImageView. Now my query is can I get the name of the image?? which is set on the ImageView??? I have to save it somehwere. @Override public void onClick(View view) { // TODO Auto-generated method stub final Dialog groupIconsDialog = new Dialog(CreateGroupActivity.this); groupIconsDialog.setTitle(

Adding UILabels and UIImageViews to UIScrollView programmatically

北战南征 提交于 2019-12-12 19:50:52
问题 I know this question is on here a lot, but I still can't seem to get this to work. I'm probably not initiating the view correctly or something... Anyway, I'm trying to add several labels and images to a UIScrollView programmatically. Here is my code for my .h file: #import <UIKit/UIKit.h> @interface DOR_HelpViewController : UIViewController <UIScrollViewDelegate> { IBOutlet UIScrollView *scrollView; } @property (nonatomic, retain) IBOutlet UIScrollView *scrollView; @end And my .m file:

how to display images in imageview in iphone

≡放荡痞女 提交于 2019-12-12 19:17:32
问题 Iam new to iphone currently my problem is i displayed 6 images in 6 image views It was not showing images in imageview I think the imageviews are in large size i implement code like this. imageview1 = [[UIImageView alloc] init]; UIImage *img1 = [UIImage imageNamed:@"wolf.jpg"]; [imageview2 setImage:img1]; so plz send me correct code for this imageview. Thank u in advance. 回答1: First of all, you're adding the image 1 to imageview 2 - are you sure you want to do this? Secondly, you need to add

stop UIimageview animation at last image

我与影子孤独终老i 提交于 2019-12-12 18:24:39
问题 NSArray *imageNames = @[@"2_00000.png", @"2_00001.png", @"2_00002.png", @"2_00003.png", @"2_00004.png", @"2_00005.png", @"2_00006.png", @"2_00007.png", @"2_00008.png", @"2_00009.png", @"2_00010.png", @"2_00011.png", @"2_00012.png", @"2_00013.png", @"2_00014.png", @"2_00015.png", @"2_00016.png", @"2_00017.png", @"2_00018.png", @"2_00019.png", @"2_00020.png", @"2_00021.png", @"2_00022.png", @"2_00023.png", @"2_00024.png", @"2_00025.png", @"2_00026.png", @"2_00027.png", @"2_00028.png", @"2_00029

iOS: Autosizing not working on UIImageView

只谈情不闲聊 提交于 2019-12-12 17:31:00
问题 I am making a very simple app to learn Objective-C and Xcode. The app has an UIButton and a UIImageView. When the user taps the button the image moves down in a diagonal motion from right to left and when it reaches a certain point in the screen it regenerates back to do the same all over again as shown in the image below: (Using an 'if statement') When I open the iOS simulator using iPhone Retina (4-inch) it works perfectly fine. The problem is when I open the simulator using iPhone Retina

alternative for uiimageview isanimating

谁说胖子不能爱 提交于 2019-12-12 17:15:24
问题 i have a code which does some actions after UIImageView.isAnimating is false but funny part is it never goes false its always in YES state. " isAnimating return is faulty for UIImageView for iPhone " people from this link see the same fault with IOS4.x so can anyone please suggest any alternative to check whetheror not UIImageview is animating ? 回答1: The following suggestions are not ideal, but I guess UIImageView should undergo improvements to become ideal in supporting animations. Anyways,