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 > iOS - UISearchBar Not shifting up is it's possible



 

iOS - UISearchBar Not shifting up is it's possible

 



Topic : 099087



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



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




UISearchBar Not shifting up is it's possible


after

i want this type only uisearchbar show same place only

before



Tag : Mobile, iOS, iPhone, Objective-C







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-08-14 13:49:51 By : vishwa View : 1363 Reply : 12
 

 

No. 1



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



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


Hi,sathish

remove UISearchDisplayController in .xib file

Thanks






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-14 13:59:55 By : j4kkapongz
 


 

No. 2



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



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


I remove UISearchDisplayController in .xib file

search is not working
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-14 14:39:10 By : vishwa
 

 

No. 3



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



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


When u remove UISearchDisplayController u cannot use searchResultsTableView in UISearchDisplayController

change logic to boolean flag isSearching when searchBarTextDidBeginEditing set isSearching to YES and end set
isSearching to NO

in number of rows check

Code
if(isSearching) { return search result; }else{ return items; }


in cell for row check

Code
if(isSearching) { //get item from result }else{ //get original item }



if not work, i want to see your code

thanks
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-14 14:54:17 By : j4kkapongz
 


 

No. 4



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



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


Thanks
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-14 16:24:36 By : vishwa
 


 

No. 5



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



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


I use this method. after search not reload tableview

Code (Objective-C)
 -(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
 {
 if([searchText length] == 0)
 {
 [displayObject removeAllObjects];
 [displayObject addObjectsFromArray:myObject];
 }
 else
 {
 [displayObject removeAllObjects];
 for(NSDictionary *tmpDict in myObject)
 {
 // NSString *val = [tmpDict objectForKey:jobid];
 NSMutableString *val;
 val = [NSString stringWithFormat:@"%@  %@ %@  %@ %@"
 ,[tmpDict objectForKey:jobid]
 ,[tmpDict objectForKey:position]
 ,[tmpDict objectForKey:rate]
 ,[tmpDict objectForKey:city]
 ,[tmpDict objectForKey:state]
 ];
 
 NSRange r = [val rangeOfString:searchText options:NSCaseInsensitiveSearch];
 if(r.location != NSNotFound)
 {
 [displayObject addObject:tmpDict];
 
 }
 
 }

 }
     [tableView1 reloadData];

 }
 

 
 -(void) searchBarSearchButtonClicked:(UISearchBar *)searchBar{
 
 [searchBar setShowsCancelButton:NO animated:YES];
 [searchBar resignFirstResponder];
 tableView1.allowsSelection = YES;
 tableView1.scrollEnabled = YES;
 
 }
 
 - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar {
 [searchBar setShowsCancelButton:YES animated:YES];
 // tableViewObj.allowsSelection = NO;
 tableView1.scrollEnabled = NO;
 }
 
 - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
 searchBar.text=@"";
 
 [searchBar setShowsCancelButton:NO animated:YES];
 [searchBar resignFirstResponder];
 tableView1.allowsSelection = YES;
 tableView1.scrollEnabled = YES;
   [tableView1 reloadData];
 }


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-15 12:14:43 By : vishwa
 


 

No. 6



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



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


Hi,sathish


i want to see more code at UITableViewDatasource and UITableViewDelegate

-numberOfSection
-numberOfRowsInSection
-CellForRowAtIndexPath
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-15 16:26:18 By : j4kkapongz
 


 

No. 7



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



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


OK

.h file

Code (Objective-C)
@interface Viewcontroller : UIViewController <UITableViewDataSource, UIAccelerometerDelegate, UISearchBarDelegate>
{
    IBOutlet UITableView *tableView1;
   }
@property(nonatomic, strong) IBOutlet UITableView *tableView1;

@end



.m file

Code (Objective-C)
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return displayObject.count;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle : UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
        cell.opaque = NO;
        cell.textLabel.backgroundColor = [UIColor clearColor];
        cell.detailTextLabel.backgroundColor = [UIColor clearColor];
    }
    
    
    NSDictionary *tmpDict = [displayObject objectAtIndex:indexPath.row];
    
    // JobID & Position
    NSMutableString *text;
    text = [NSString stringWithFormat:@"%@  %@"
            ,[tmpDict objectForKey:jobid]
            ,[tmpDict objectForKey:position]];
    // City,State & Rate
    NSMutableString *detail;
    detail = [NSString stringWithFormat:@"         %@ ,%@ ,%@"
              ,[tmpDict objectForKey:city]
              ,[tmpDict objectForKey:state]
              ,[tmpDict objectForKey:rate]];
    
    cell.textLabel.text = text;
    cell.detailTextLabel.text= detail;
    [cell.textLabel setFont:[UIFont fontWithName:@"Avenir Bold" size:14]];
    cell.detailTextLabel.textColor = [UIColor darkGrayColor];
    [cell.detailTextLabel setFont:[UIFont fontWithName:@"Avenir" size:15]];

        return cell;
       
}




ประวัติการแก้ไข
2013-08-16 10:52:07
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-16 10:50:43 By : vishwa
 


 

No. 8



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

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

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


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-16 12:27:41 By : mr.win
 


 

No. 9



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



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


Hi,sathish

Before reload table nslog to diplay values, it have?

Add break point in cell for row when you reload you get it and check value?
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-18 20:37:36 By : j4kkapongz
 


 

No. 10

Guest


คุณปลา สุดยอดจริงๆ ฝากเป็นลูกศิษย์ด้วยคนครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-20 10:20:43 By : phpbasic
 


 

No. 11



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

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

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

ว่าง ๆ อยากมาชวนแลกเปลี่ยนกันบ้างครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-20 10:46:52 By : mr.win
 


 

No. 12



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



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


ตอบความคิดเห็นที่ : 11 เขียนโดย : mr.win เมื่อวันที่ 2013-08-20 10:46:52
รายละเอียดของการตอบ ::

ได้เลยคับ ไว้จะเข้ามาบ่อยๆ ผมกำลังหาที่สิงอยู่พอดี 555+


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-08-20 11:52:37 By : j4kkapongz
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : iOS - UISearchBar Not shifting up is it's possible
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 02
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 อัตราราคา คลิกที่นี่