Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Mobile > Mobile Forum > How to array of images delete specific image from imageview with scrollview in ios/iphone



 

How to array of images delete specific image from imageview with scrollview in ios/iphone

 



Topic : 102989



โพสกระทู้ ( 274 )
บทความ ( 0 )



สถานะออฟไลน์




How to array of images delete specific image from imageview with scrollview in ios/iphone



Tag : Mobile, iOS, iPhone, Objective-C







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-11-23 15:43:39 By : vishwa View : 1339 Reply : 5
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

You have screenshot ?






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-24 11:07:19 By : mr.win
 


 

No. 2



โพสกระทู้ ( 274 )
บทความ ( 0 )



สถานะออฟไลน์


Image galley

image_gallery

which image you select go to next page show that particular image

scrollimage

This is my code for particular image and scroll next image
Code (Objective-C)

    arrayOfImages = [[NSMutableArray alloc]init];    
    
    NSString *stringPath = [NSString stringWithFormat:@"%@/images/",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES)objectAtIndex:0]];
    
    NSArray *filePathsArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:stringPath error:nil];
    
   
    for(i=0;i<[filePathsArray count];i++)
    {
        NSString *strFilePath = [filePathsArray objectAtIndex:i];
        if ([[strFilePath pathExtension] isEqualToString:@"jpg"] || [[strFilePath pathExtension] isEqualToString:@"png"] || [[strFilePath pathExtension] isEqualToString:@"PNG"])
        {
            NSString *imagePath = [stringPath stringByAppendingPathComponent:strFilePath];
            
            NSData *data = [NSData dataWithContentsOfFile:imagePath];
            if(data)
            {
                UIImage *image = [UIImage imageWithData:data];
                [arrayOfImages addObject:image];
            }
        }
    
    }
   
    int x = 0;
    int y = 0;
 
    for (j=0; j<arrayOfImages.count;j++){
        
        imageView1=[[UIImageView alloc]initWithFrame:CGRectMake(x,y,320,400)];
        imageView1.image=[arrayOfImages objectAtIndex:j];
        [imgscrl addSubview:imageView1];
         x=x +320;
        
    }
	[imgscrl setContentOffset:CGPointMake((_myInteger*320), 400)];
    imgscrl.contentSize=CGSizeMake(x, y);
    imgscrl.pagingEnabled=TRUE;




I want how to delete that particular image.
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-26 12:39:36 By : vishwa
 

 

No. 3



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์


1. find image position,index in array for remove

get page in uiscrollview

int page = scrollView.contentOffset.x / scrollView.frame.size.width;

2. remove objects in nsarray

[anArray removeObjectAtIndex: page];

3. remove uiimageview in uiscrollview

for (uiimageview *subview in [uiscrollview subviews])
{
if (subview.tag == 1000 + page)
{
[subview removeFromSuperview];
}
}
4. set contentsize and contentoffset in uiscrollview
CGSizeMake(320.0f * [anArray count], 400.0f)
CGPointMake(320.0f * page, 400.0f)

hope to help you, unless you want to remove from image file .png/.jpg/
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-26 18:01:15 By : winterlovesong
 


 

No. 4



โพสกระทู้ ( 274 )
บทความ ( 0 )



สถานะออฟไลน์


Thanks now working perfect.


ประวัติการแก้ไข
2013-11-27 10:25:03
2013-11-27 11:10:46
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-27 10:22:43 By : vishwa
 


 

No. 5



โพสกระทู้ ( 17 )
บทความ ( 0 )



สถานะออฟไลน์


more code for smooth,

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.50];

scrollview.contentOffset = CGPointMake(320.0f * page, 400.0f);

[UIView commitAnimations];

hope to help you
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-27 11:43:15 By : winterlovesong
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : How to array of images delete specific image from imageview with scrollview in ios/iphone
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่