autosize

Delphi FMX TCheckbox/TRadiobutton Autosize

痞子三分冷 提交于 2021-02-10 06:46:26
问题 I want dynamically created Checkboxes and Radiobuttons (in FMX, not VCL) with a fixed Width to change their Heigth based on their containing text. My Checkboxes and Radiobuttons have WordWrap enabled. So I want to get something like the TLabel does, when AutoSize and WordWrap are enabled. I've already managed to get close to this: procedure TFMenu.Button1Click(Sender: TObject); var ctr: Integer; hostingComponent: TComponent; begin hostingComponent := Form1; { in my case a Frame or Panel or

UITableViewCell with intrinsic height based on width

被刻印的时光 ゝ 提交于 2021-01-29 15:39:44
问题 So I have made custom view ExpressionView for visualizing mathematical expression. Every part of expression is UILabel holding one number or operation, and labels are aligned inside the ExpressionView in right-justified rows. I expect ExpressionView to have width defined by autolayout constraints from outside, but height should be intrinsic, depending on how many rows of labels I will have to make for a given width. The aligning methods works well, I use frame.size of each label and width of

Dynamic ellipsis support for Android autosizing TextViews

…衆ロ難τιáo~ 提交于 2020-06-25 09:02:10
问题 The new Autosizing TextViews are pretty awesome, but it seems a fundamental thing is missing: ellipses. Adding ellipses still requires defining the maxLines attribute, but if I want to be able to dynamically resize the text size according to the text view boundaries, I'd also like to be able to dynamically add ellipses when needed. Right now, if the text doesn't fit even with the minimum text size, it just gets cropped. How could I add support for dynamic ellipses without giving up the new

UICollectionView autosize and dynamic number of rows

北慕城南 提交于 2020-02-20 08:18:45
问题 I am trying to do something like this: Basically, I am using a UICollectionView and the cells (3 diferent .xib ). So far, it works. The thing I want to do is: Set a autoheight If rotate, add 1 row to the UIColectionView 2.1 If tablet, on portrait will have 2 rows and landscape 3 rows. (which basically is the same of point 2, only adding 1 row. I have something like this: extension ViewController { override func viewWillTransition(to size: CGSize, with coordinator:

Subview Doesnt AutoSize When Added to Root View Controller

旧巷老猫 提交于 2020-01-23 03:32:05
问题 I have a root view controller that will have up to 10 or so subviews. I am implementing autorotation/autosize accross the entire app. My problem is this: - When I allocate all the view controllers and add each as a subview to the root controller during startup, everything works as it should. The only problem is that each view controller needs time to initialize. This causes my application to load very slowly. Instead I am trying to allocate the view controllers as they are required. Now I

iOS: Autosizing an UIImage programmatically

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-16 17:35:55
问题 I have an UIImage in my app, and I had to uncheck the auto layout box and set autosizing with the options shown in the image below so the image will show properly in both screen sizes (3.5 inch, and 4 inch) My question is, how can I set these options in code? I tried this but it doesn't seem to work? Am I doing something wrong? file.m // Autosizing ImageOne ImageOne.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth |

In WPF, how do I get the content of a tabItem to fill available space?

十年热恋 提交于 2020-01-14 11:46:40
问题 I do not know what I am doing wrong here. In the XAML below, the Border does not fill the available space on the tabItem (just lots of whitespace). How do I fill the entire tab page? <TabControl> <TabItem Header="Plant State"> <Border Background="Red" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"></Border> </TabItem> </TabControl> 回答1: I figured this out with the help of Matt Hamilton. This actually works fine if you are using a regular TabControl (default Template). I am using a

C# DataGridView AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells

吃可爱长大的小学妹 提交于 2020-01-14 10:48:26
问题 I am displaying a table with up to 100,000 rows in a DataGridView. The table has one column which contains large strings. I found out that setting AutosizeMode to AllCells causes the application to freeze for a long time while its computing the required width. As a compromise, I set the Autosize mode to DisplayedCells. I then bound a method to the dataGrid's scroll event: public void MethodThatBindsDataToTheDatagridview(DataTable table) { dataGrid.Source = table; dataGrid.Columns[1]

How to speed up autosizing columns in apache POI?

烈酒焚心 提交于 2020-01-10 07:55:23
问题 I use the following code in order to autosize columns in my spreadsheet: for (int i = 0; i < columns.size(); i++) { sheet.autoSizeColumn(i, true); sheet.setColumnWidth(i, sheet.getColumnWidth(i) + 600); } The problem is it takes more than 10 minutes to autosize each column in case of large spreadsheets with more than 3000 rows. It goes very fast for small documents though. Is there anything which could help autosizing to work faster? 回答1: Solution which worked for me: It was possible to avoid

Auto size Button Style

拜拜、爱过 提交于 2020-01-05 06:38:46
问题 I have this Style : <!--Normal Button Style --> <Style TargetType="{x:Type Button}" x:Key="NormalButtonStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ButtonBase}"> <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Effect="{DynamicResource ShadowEffect}" > <Grid.ColumnDefinitions> <ColumnDefinition Width="16"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Image Source="{Binding RelativeSource={RelativeSource TemplatedParent},