草庐IT

setMargins

全部标签

windows - 为什么 EM_SETMARGINS 在 Windows 7 下不起作用?

我有一个复合视觉控件,它由编辑框和一个下拉按钮组成。下拉按钮不是窗口控件,而是绘制在编辑框上。我通过以下调用限制编辑的宽度:SendMessage(Handle,EM_SETMARGINS,EC_RIGHTMARGIN,(DropDownButtonWidth+2)shl16);它在WindowsXP下工作正常但在Windows7下不起作用。在后一种情况下,当焦点编辑框与下拉按钮重叠并删除其图像时。在两种操作系统下限制编辑框矩形的正确方法是什么?PS:我也试过另一种方法:SendMessage(Handle,EM_GETRECT,0,LongInt(@Loc));Loc.Bottom:

android - ImageView setMargins 不起作用

我有一个包含2个图像的FrameLayout,一个大的用来填充FrameLayout,另一个非常小的我想移动。我试着像这样移动小的:xml文件和代码:imgPosition=(ImageView)findViewById(R.id.imgPosition);FrameLayout.LayoutParamslp=newFrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT);//Neitherthis://lp.setMargins(30,20

android - setmargin 在 android 中的相对布局中不起作用

我以编程方式在相对布局中创建了2个按钮。我希望按钮之间没有边距空间,并试图通过使用“setmargin”来实现这一点,但失败了。下面是代码。//creatingtherelativelayoutRelativeLayoutrelativeLayout=newRelativeLayout(this);RelativeLayout.LayoutParamsrlp=newRelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,RelativeLayout.LayoutParams.MATCH_PARENT);/

android - 对于 Relative LayoutParams,SetMargin 以编程方式无法正常工作

我目前正在以编程方式添加封装在线性布局中的RelativeLayout。基础是一个ScrollView,我正在尝试将这些布局添加到名为svbase的ScrollView中LinearLayoutllbase=newLinearLayout(getApplicationContext());LinearLayout.LayoutParamsllbaseParams=newLinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT);//Ver

java - iText 中的 setMargins 方法是否有效?

iText中的setMargins方法是否以常规方式工作?我尝试了以下方法:System.out.println(f.exists());Documentdocument=newDocument(PageSize.A4,36,36,36,36);PdfWriterwriter=PdfWriter.getInstance(document,newFileOutputStream(f.getAbsolutePath()+"0.pdf"));document.open();//readerPdfReaderreader=newPdfReader(newFileInputStream(f));

android - 忽略 setMargin() 的相对布局

我正在尝试将RelativeLayout嵌套在LinearLayout内,并给RelativeLayout一个边距,使其边缘远离LinearLayout的边缘。到目前为止,我有这个:LayoutInflater.from(context).inflate(R.layout.conversation_view_layout,this,true);this.setLayoutParams(newMarginLayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));inttbm=AllConversationsAct