2012-11-09 24 views
6

मेरे संग्रह दृश्य कोशिका संरचनालागू करने छाया अपने पाठ धुँधली बनाता

enter image description here

नीचे के रूप में वर्णन किया गया है के लिए cellItemAtIndex, मैं निम्नलिखित है

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 
    UICollectionViewCell *cell = [self.collectionView dequeueReusableCellWithReuseIdentifier:@"reusedCell" forIndexPath:indexPath]; 


    // Set shadow around the cell 
    [cell.layer setMasksToBounds :NO ]; 
    [cell.layer setShadowColor  :[[UIColor whiteColor ] CGColor ] ];// shadow's color 
    [cell.layer setShadowOpacity :0.65 ];       // set the opacty 
    [cell.layer setShadowRadius  :5.0 ];        // set the blur radius 
    [cell.layer setShadowOffset  :CGSizeMake(0 , 0) ];    // set shadow position 
    [cell.layer setShouldRasterize :YES ];        // tell the cell to render it’s CALayer as a bitmap 
    [cell.layer setShadowPath  :[[UIBezierPath bezierPathWithRect:cell.bounds ] CGPath ] ]; // use a path to draw its shadow instead of using its 
    ...................................................................... 
} 

जब मैं चलाने डिवाइस पर आवेदन, छाया दिखाया गया है। हालांकि, लेबल के लिए मेरा पाठ धुंधला है। कृपया imaged निम्नलिखित मेरे डिवाइस

enter image description here

से लिया अगर मैं बोडे ब्लॉक जो छाया ड्रॉप किया जाता है uncomment पर एक नज़र डालें, पाठ निम्न छवि enter image description here

मैं के रूप में इतना स्पष्ट कर रहे हैं मैं .... पूरी तरह खो गया हूँ। क्या किसी के पास इस मुद्दे के बारे में कोई विचार है। कृपया

+0

क्या किसी के पास इस बारे में कोई विचार था ??? – tranvutuan

+0

आपने मुझे आदमी बचाया। tnxx alot – posha

उत्तर

3

मैं setShouldRasterize, setShadowOffset और setShadowPath को हटा दूंगा। यह उनके बिना ठीक काम करेगा।

8

आप परत को रास्टराइज कर रहे हैं, लेकिन डिफ़ॉल्ट रास्टरराइजेशन स्केल 1.0 है। इसे रेटिना डिस्प्ले के लिए 2.0 पर सेट करने की आवश्यकता है, अन्यथा परत केवल आधे रिज़ॉल्यूशन के साथ प्रस्तुत की जाती है।

cell.layer.rasterizationScale=[[UIScreen mainScreen] scale]; 
+0

यह सही उत्तर होना चाहिए:) – mskw

+0

यह कई अन्य उत्तरों से गायब था जो बताते हैं कि ड्रॉप छाया कैसे लागू करें। धन्यवाद। – guptron

संबंधित मुद्दे