Jump to content

How to set UnimSegmentedButton's Image above the text?


Recommended Posts

49 minutes ago, Marco Hsu said:

I want to set UnimSegmentedButton's Image above the text,like the second image. Tks!

Hello,

One possible solution:

procedure TMainmForm.UniFormCreate(Sender: TObject);
begin
  UnimSegmentedButton1.JSInterface.JSAddListener(
    'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top")})}'
  );
end;

 

Link to post
Share on other sites
1 hour ago, Sherzod said:

Hello,

One possible solution:


procedure TMainmForm.UniFormCreate(Sender: TObject);
begin
  UnimSegmentedButton1.JSInterface.JSAddListener(
    'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top")})}'
  );
end;

 

Thank you,but I have a small question:

I cannot set the Image's Height and Wight.The Image is very small when the form is showing.

12.jpg

Link to post
Share on other sites
19 hours ago, Marco Hsu said:

kaoqinyi.rar 5.67 MB · 5 downloads

Hello,

Try this:

sgbtn1.JSInterface.JSAddListener(
    'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top"); button.iconElement.setStyle("width", "64px"); button.iconElement.setStyle("height", "64px");})}'
  );

 

Link to post
Share on other sites
2 hours ago, Sherzod said:

Hello,

Try this:


sgbtn1.JSInterface.JSAddListener(
    'painted', 'function(){this.getItems().each(function(button){button.setIconAlign("top"); button.iconElement.setStyle("width", "64px"); button.iconElement.setStyle("height", "64px");})}'
  );

 

OK,Tks!

Link to post
Share on other sites
×
×
  • Create New...