M Mike1970 Well-Known Member Licensed User Longtime User Feb 17, 2021 #1 Hi everyone, how can i individually change the corner radius of a view (in this case a label)? Thanks in advance
Hi everyone, how can i individually change the corner radius of a view (in this case a label)? Thanks in advance
Semen Matusovskiy Well-Known Member Licensed User Feb 17, 2021 #2 In IOS 11+ you can choose, which corners to round. For example, you want to round left-top and right-top corners only. In designer set Label's corner radius. In run-time after LoadLayout B4X: Dim no As NativeObject = Label1 no.GetField ("layer").SetField ("maskedCorners", 1 + 2) If you want to round bottom corners use 4 + 8 instead of 1 + 2 (1 means left-top, 2 - right-top, 4 - left bottom, 8 right - bottom. Upvote 0
In IOS 11+ you can choose, which corners to round. For example, you want to round left-top and right-top corners only. In designer set Label's corner radius. In run-time after LoadLayout B4X: Dim no As NativeObject = Label1 no.GetField ("layer").SetField ("maskedCorners", 1 + 2) If you want to round bottom corners use 4 + 8 instead of 1 + 2 (1 means left-top, 2 - right-top, 4 - left bottom, 8 right - bottom.
M Mike1970 Well-Known Member Licensed User Longtime User Feb 17, 2021 #3 Semen Matusovskiy said: In IOS 11+ you can choose, which corners to round. For example, you want to round left-top and right-top corners only. In designer set Label's corner radius. In run-time after LoadLayout B4X: Dim no As NativeObject = Label1 no.GetField ("layer").SetField ("maskedCorners", 1 + 2) If you want to round bottom corners use 4 + 8 instead of 1 + 2 (1 means left-top, 2 - right-top, 4 - left bottom, 8 right - bottom. Click to expand... Thanks Semen it worked!! Upvote 0
Semen Matusovskiy said: In IOS 11+ you can choose, which corners to round. For example, you want to round left-top and right-top corners only. In designer set Label's corner radius. In run-time after LoadLayout B4X: Dim no As NativeObject = Label1 no.GetField ("layer").SetField ("maskedCorners", 1 + 2) If you want to round bottom corners use 4 + 8 instead of 1 + 2 (1 means left-top, 2 - right-top, 4 - left bottom, 8 right - bottom. Click to expand... Thanks Semen it worked!!
MikeH Well-Known Member Licensed User Longtime User Feb 10, 2022 #4 Is this possible with a listview? I get "Types do not match" error even with listview1.as(Label) Thanks Upvote 0
Is this possible with a listview? I get "Types do not match" error even with listview1.as(Label) Thanks
Semen Matusovskiy Well-Known Member Licensed User Feb 11, 2022 #5 It's not clear, what do you name 'ListView'. If CustomListView, use, for example, B4X: CustomListView1.GetBase.As(NativeObject).GetField ("layer").SetField ("maskedCorners", 1 + 2) Upvote 1
It's not clear, what do you name 'ListView'. If CustomListView, use, for example, B4X: CustomListView1.GetBase.As(NativeObject).GetField ("layer").SetField ("maskedCorners", 1 + 2)