size

UILabel自适应高度和自动换行- OC swift

这一生的挚爱 提交于 2019-12-03 16:38:32
加粗; [UILabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]]; 加粗并且倾斜 [UILabel setFont:[UIFont fontWithName:@"Helvetica-BoldOblique" size:20]]; guessLikeLabel.font = UIFont(name: "Helvetica-Bold", size: 14) // 初始化 label UILabel *label = [[UILabel alloc] init]; NSString *text = @" 这是一个测试!!! adsfsaf 时发生发勿忘我勿忘我勿忘我勿忘我勿忘我阿阿阿阿阿阿阿阿阿阿阿阿阿啊 00000000 阿什顿。。。 " ; label. text = text; [label setNumberOfLines:0]; UIFont *font = [UIFont fontWithName:@"Arial" size:14]; // 设置字体 label. font = font; CGSize constraint = CGSizeMake ( 300 , 20000.0f ); CGSize size = [text sizeWithFont :font constrainedToSize

Android app: Support all screen sizes

耗尽温柔 提交于 2019-12-03 16:35:56
According to this there are four size screens, small, normal, large and xlarge. So these qualifiers correspond on specific screens. For example, normal qualifier is a 3.7inches screen and small is a 2.7inches screen. So, what happens with the others sizes? How does my app cover other sizes, like 3.3inches or 3.2inches for example? The screen sizes you mentioned are meant to be ranges. For instance, a 3.3 inch screen would probably fall into the 'normal' category , as it is bigger than the 2.7, but less than 3.7. now that said, there are some minor changes in terms of pixel density and that

FB.ui and setting popup size

被刻印的时光 ゝ 提交于 2019-12-03 16:27:14
I am using FB.ui with the display parameter set to popup. When the method is 'stream.publish', it autoresizes when the content is loaded. However, when using 'fbml.dialog' (in order to display a multi-friend selector) it shows a size that I'm not able to change (and the content is displayed cropped). I have tried with the following approaches, with no luck: FB.ui({ method: 'fbml.dialog', size: {width: 800, height: 500}, ... FB.ui({ method: 'fbml.dialog', width: 800, height: 500, ... Also I've been looking at the API source code, and it declares the method this way: Method declaration: 'fbml

Automatic SystemVerilog variable size using interface width and $size?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 16:10:57
I am trying to make a module (a DSP in my case) with a standardized memory interface in SystemVerilog, and would like the variables in the module to size automatically based on the bus widths in the attached interface. My rationale: this makes the code more portable by allowing it to auto-size to any connected interface, instead of requiring an HDL coder to pass in parameters that tell the module the widths of all the interface busses that will connect to it (not that this would be terrible, it just seems cleaner without the parameters). I can't seem to get this to work, however. Here's an

C++/Size of a 2d vector

非 Y 不嫁゛ 提交于 2019-12-03 15:13:43
问题 How do I find the size of a 2 dimensional vector? So far I have the following code which doesn't compile. #include <iostream> #include <vector> using namespace std; int main() { vector < vector <int> > v2d; for (int x = 0; x < 3; x++) { for (int y = 0; y < 5; y++) { v2d.push_back(vector <int> ()); v2d[x].push_back(y); } } cout<<v2d[0].size()<<endl; cout<<v2d[0][0].size()<<endl; return 0; } 回答1: To get the size of v2d , simply use v2d.size() . For size of each vector inside v2d , use v2d[k]

How to set drawable size in layer-list

夙愿已清 提交于 2019-12-03 14:35:37
问题 I'm having problem with setting size of drawable in layer-list. My XML looks like this: <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/menu_drawable1"/> <item android:drawable="@drawable/menu_drawable2"/> </layer-list> Drawable1 is bigger than Drawable2, so Drawable2 gets resized. How to override this and set the original size of Drawable2? I don't want it to resize. I tried with setting width and height but that doesn't work. Also

Printing HTML5 Canvas in the correct size

♀尐吖头ヾ 提交于 2019-12-03 13:48:48
问题 Is there a correct way to specify the size of a canvas element in for example millimeters so that if I print it out it will have the correct size? I've tried this simple example: <!DOCTYPE html> <html> <body> <canvas id="myCanvas" style="border:1px solid #c3c3c3; width:50mm; height:50mm;"> Your browser does not support the HTML5 canvas tag. </canvas> <script> var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.fillStyle = "#FF0000"; ctx.fillRect(0,0,150,75); <

Display directory structure with size in Powershell

萝らか妹 提交于 2019-12-03 13:44:18
问题 Trying to have "dir" command that displays size of the sub folders and files. After googling "powershell directory size", I found thew two useful links Determining the Size of a Folder http://technet.microsoft.com/en-us/library/ff730945.aspx PowerShell Script to Get a Directory Total Size PowerShell Script to Get a Directory Total Size These soultions are great, but I am looking for something resembles "dir" output, handy and simple and that I can use anywhere in the folder structure. So, I

Automatic code deduplication of assembly language?

一曲冷凌霜 提交于 2019-12-03 13:29:54
I've been going through some Assembly Programming Videos to get a better understanding of how to manually optimize the *.s files left after compiling with gcc/g++ -S ... One of the topics covered was Refactoring Redundant Code that demonstrates how to move redundant code to its own labeled block ending with a ret and replacing it with a call . The example given in the video is 2 blocks containing: mov eax,power mul ebx mov power,eax inc count which it replaces with call CalculateNextPower and CalculateNextPower looks like: CalculateNextPower: mov eax,power mul ebx mov power,eax inc count ret

一个汇编写的BASE64

笑着哭i 提交于 2019-12-03 13:29:44
一个汇编写的BASE64 unit Base64; { procedure TForm1.Button1Click(Sender: TObject); var Source, Dest: TStream; begin if OpenDialog1.Execute then begin Source := TFileStream.Create(OpenDialog1.FileName, fmOpenRead); // 打开源文件 Dest := TFileStream.Create('Base64EncodeTest.txt', fmCreate); // Base64编码文件 try Base64Encode(Source, Dest); finally Source.Free; Dest.Free; end; Source := TFileStream.Create('Base64EncodeTest.txt', fmOpenRead); // 打开编码文件 Dest := TFileStream.Create('2.exe', fmCreate); // 还原源文件内容 try Base64Decode(Source, Dest); Dest.Position := 0; finally Source.Free; Dest.Free; end; end; end; }