ACFloatingTextfield icon indicating copy to clipboard operation
ACFloatingTextfield copied to clipboard

leftView and rightView??

Open Zhangguiguang opened this issue 7 years ago • 7 comments

Hello! I'm use the OC version. If I add leftView or rightView for ACFloatingTextfield, the text will be overlay with the leftView or rightView.

Zhangguiguang avatar Oct 30 '17 03:10 Zhangguiguang

same issue

sudhakar-codes avatar Oct 30 '17 09:10 sudhakar-codes

for this you will need to override the drawTextInRect method you can also check accessory branch for this Thanks

On Mon, 30 Oct 2017 at 2:34 PM, Sudhakar Varma Dasari < [email protected]> wrote:

same issue

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ErAbhishekChandani/ACFloatingTextfield/issues/42#issuecomment-340382933, or mute the thread https://github.com/notifications/unsubscribe-auth/ANMZ11Hqdhu8hShiCa2YaRzPH65Usa4Gks5sxZEvgaJpZM4QKn3C .

-- Thanks & Regards Er. Abhishek Chandani

ErAbhishekChandani avatar Oct 30 '17 09:10 ErAbhishekChandani

I think it's should override the [ textRectForBounds:] and [ editingRectForBounds:]..

- (CGRect)textRectForBounds:(CGRect)bounds {
    CGFloat left = 0;
    CGFloat right = 0;
    if (self.leftViewMode == UITextFieldViewModeUnlessEditing ||
        self.leftViewMode == UITextFieldViewModeAlways) {
        left = self.leftView.bounds.size.width + 10;
    }
    if (self.rightViewMode == UITextFieldViewModeUnlessEditing ||
        self.rightViewMode == UITextFieldViewModeAlways) {
        right = self.rightView.bounds.size.width;
    }
    return CGRectMake(4+left, 1, bounds.size.width-left-right, bounds.size.height);
}

- (CGRect)editingRectForBounds:(CGRect)bounds {
    CGFloat left = 0;
    CGFloat right = 0;
    if (self.leftViewMode == UITextFieldViewModeWhileEditing ||
        self.leftViewMode == UITextFieldViewModeAlways) {
        left = self.leftView.bounds.size.width + 10;
    }
    if (self.rightViewMode == UITextFieldViewModeWhileEditing ||
        self.rightViewMode == UITextFieldViewModeAlways) {
        right = self.rightView.bounds.size.width;
    }
    
    return CGRectMake(4+left, 1, bounds.size.width-left-right, bounds.size.height);
}

Zhangguiguang avatar Oct 31 '17 05:10 Zhangguiguang

same error how to solve it. i am using arabic language first letter missing. i need swift code. can please tell me

santhoshappdev avatar Oct 09 '18 09:10 santhoshappdev

There is also swift code in github you can check source swift folder there for same Thanks

Sent from my iPhone

On 09-Oct-2018, at 2:57 PM, santhoshappdev [email protected] wrote:

i need swift code. can please tell me

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ErAbhishekChandani avatar Oct 09 '18 09:10 ErAbhishekChandani

Hello still facing problem ,anyone find solution Thanks

kirti301290 avatar Dec 13 '20 13:12 kirti301290

Will check it soon but will not be able check before a week Meanwhile please checkout the master branch and override the left value in drawTextInRect Method.

Thanks Abhishek

On Sun, 13 Dec 2020 at 6:58 PM, kirti Chavda [email protected] wrote:

Hello still facing problem ,anyone find solution Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ErAbhishekChandani/ACFloatingTextfield/issues/42#issuecomment-744007919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJRTV2FYBCZ4BX4HZSDQDDSUS6QJANCNFSM4EBKPXBA .

-- Thanks & Regards Er. Abhishek Chandani

ErAbhishekChandani avatar Dec 13 '20 13:12 ErAbhishekChandani