标签: width

使用<col width ="x*"/>设置比例列宽

我试图设置比例列宽<col width="x*" />:

<table width="600px">
    <col width="1*" />
    <col width="2*" />
    <col width="3*" />
    <tbody>
        <tr>
            <td style="border: 1px solid black;">AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA
            </td>
            <td style="border: 1px solid black;">BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB …
Run Code Online (Sandbox Code Playgroud)

html html-table width

5
推荐指数
1
解决办法
4143
查看次数

如何在ASP.NET中将文本框的宽度设置为与MaxLength相同

有没有办法可以限制文本框的宽度等于MaxLength属性?在我的情况下,文本框控件放在表格单元格中,就像在此片段中一样:

<td class=TDSmallerBold style="width:90%">
        <asp:textbox id="txtTitle" runat="server"
            CausesValidation="true"
            Text="Type a title here..be concise but descriptive. Include price."
            ToolTip="Describe the item with a short pithy title (most important keywords first). Include the price. The title you provide here will be the primary text found by search engines that index Zipeee content." 
            MaxLength="60"
            Width="100%">
        </asp:textbox>
Run Code Online (Sandbox Code Playgroud)

(我知道我不应该使用HTML表来控制布局......另一个主题是肯定的)但是有没有办法将实际宽度限制为键入框中允许的最大字符数?

asp.net textbox html-table maxlength width

5
推荐指数
1
解决办法
3万
查看次数

VHDL:查找/报告整数的位宽/长度(与std_logic_vector相比)?

假设我需要一个信号来表示0到5之间的数字; 显然这需要表示3比特的std_logic(即如果MAXVAL = 5,则bitwidth = { wcalc "floor(logtwo($MAXVAL))+1"}).

我知道我能做到:

SIGNAL myLogicVector : STD_LOGIC_VECTOR(2 downto 0) := 5; 
Run Code Online (Sandbox Code Playgroud)

我明确指定了三个std_logic'位'的数组,并设置初始值; 然后我可以使用REPORT打印出长度(在本例中为3):

report("Bit width of myLogicVector is "& integer'image(myLogicVector'length));
Run Code Online (Sandbox Code Playgroud)

到现在为止还挺好.但是,假设我使用整数(数字)类型:

SIGNAL myInteger : NATURAL range 0 to 5 := 5;
Run Code Online (Sandbox Code Playgroud)

我猜这里'编译器'('合成器')会自动推断它需要3位存储长度,因为这个整数的范围是0到5之间的值.如果是这样的话,我的问题是:是有可能以某种方式在报告中打印出这个位宽/长度/大小?

当然,诀窍是这样的:

report("Bit width of myInteger is "& integer'image(myInteger'length));
Run Code Online (Sandbox Code Playgroud)

...将失败(例如,使用" HDLParsers:3389 - 属性的前缀'长度必须是数组对象 "),因为据我所知,所有这些属性类似于'length并且'range仅适用于数组(了解VHDL属性),而整数(自然)不是数组 - 它是一个数字 :)(VHDL向量整数转换问题)

再一次,我知道我可以利用log2(从最大值计算无符号变量的宽度?) - 但我想要的只是快速看到(在合成期间)"合成器"有多少'位'分配给最终的综合设计,因此在最终的FPGA资源方面将使用多少(特别是如果我使用'泛型'以某种方式计算整数的特定最大值 …

logic integer synthesis vhdl width

5
推荐指数
2
解决办法
2万
查看次数

使用match_parent属性获取WIDTH视图?

我有一个imageView带layout_width="match_parent".

在我的适配器上getView(),我想得到它的实际宽度,imageView但不知道如何.

我尝试过使用imageView.getWidth(),但这会返回0.

android view width

5
推荐指数
1
解决办法
4347
查看次数

如何绘制具有可变笔画宽度的路径

我的代码基本上来自这个例子(http://corner.squareup.com/2010/07/smooth-signatures.html)和Google API(FingerPaint),但现在我想使用该类VelocityTracker来改变笔画宽度,具体取决于在我的手指速度.

我以为我可以将路径分成更小的部分,但我没有找到任何例子.还有第二篇文章(http://corner.squareup.com/2012/07/smoother-signatures.html),但我没有特定的bezier曲线类,也没有收集所有的点,ArrayList所以他们的例子用于调整笔划宽度不是很有帮助.

有谁知道如何处理这个?两周前我开始学习代码,所以我对这些东西都很新.

编辑:我试图实现我的MotionEvents的速度,我使用LogCat来跟踪运行应用程序时的当前速度.它确实有效,但当我尝试使用速度作为mPaint.setStrokeWidth参数的一部分时,我没有得到我真正想要的东西.我从画布上绘制的路径的宽度从我开始绘制线条的那一刻起一直在变化,直到我将手指向上移动.这就是为什么我想将路径分成更小的部分,因为现在只有最后一个跟踪的速度会影响strokeWidth.

public class SignatureView extends View {

    private static final String TAG = SignatureView.class.getSimpleName();
    private static final float STROKE_WIDTH = 10;
    private static final float HALF_STROKE_WIDTH = STROKE_WIDTH / 2;
    private final double TOUCH_TOLERANCE = 5;
    private int h = getResources().getDisplayMetrics().heightPixels;
    private int w = getResources().getDisplayMetrics().widthPixels;

    private Path mPath = new Path();
    private Paint mPaint = new Paint();
    private Paint mBitmapPaint = new Paint(Paint.DITHER_FLAG);
    private Bitmap mBitmap = …
Run Code Online (Sandbox Code Playgroud)

android drawing paint width stroke

5
推荐指数
1
解决办法
7049
查看次数

Selectbox中的标签删除时,Selectbox的宽度会缩小

我使用Select2制作标签框.我添加了以下HTML代码:

<select id="tags" multiple="">
    <option value="tag_1">Tag1</option>
    <option value="tag_2">Tag2</option>
    <option value="tag_3">Tag3</option>
</select>
Run Code Online (Sandbox Code Playgroud)

我用这个JS:

$(document).ready(function() {
    $("#tags").select2({
        placeholder: "Select tag",
        allowClear: true,
        minimumInputLength: 2,
        maximumSelectionSize: 1,
    });
});
Run Code Online (Sandbox Code Playgroud)

问题是:文本框在首次加载时具有正常宽度.插入标签后,它将正确显示.但是,如果我点击退格键或点击标签的x来删除它,文本框就会缩小到5px左右.我究竟做错了什么?我也使用twitter bootstrap,有一些依赖吗?

jquery select width jquery-select2

5
推荐指数
2
解决办法
3674
查看次数

JS - File Reader API获取图像文件的大小和尺寸

您好我正在使用以下代码来使用File Reader API获取上传图像:

<script type="text/javascript">
var loadImageFile = (function () {
    if (window.FileReader) {
        var oPreviewImg = null, oFReader = new window.FileReader(),
            rFilter = /^(?:image\/bmp|image\/cis\-cod|image\/gif|image\/ief|image\/jpeg|image\/jpeg|image\/jpeg|image\/pipeg|image\/png|image\/svg\+xml|image\/tiff|image\/x\-cmu\-raster|image\/x\-cmx|image\/x\-icon|image\/x\-portable\-anymap|image\/x\-portable\-bitmap|image\/x\-portable\-graymap|image\/x\-portable\-pixmap|image\/x\-rgb|image\/x\-xbitmap|image\/x\-xpixmap|image\/x\-xwindowdump)$/i;

        oFReader.onload = function (oFREvent) {

            /*get image*/
            var _img = oFREvent.target.result;
            console.log(oFREvent.target);
            /*add img to hidden input text*/
            localStorage.photo = _img;
            oPreviewImg.src = oFREvent.target.result;
        };

        return function () {
            var aFiles = document.getElementById("imageInput").files;
            if (aFiles.length === 0) { return; }
            if (!rFilter.test(aFiles[0].type)) { 
                notify("You must select a valid image file!",3400,false); return; 
            }
            oFReader.readAsDataURL(aFiles[0]);
        }

    } …
Run Code Online (Sandbox Code Playgroud)

javascript size height width filereader

5
推荐指数
1
解决办法
1万
查看次数

ImageView getLayoutParams宽度单位

如果我想用Java以编程方式设置ImageView的宽度/高度,如下所示:

image_view.getLayoutParams().width = 200;
Run Code Online (Sandbox Code Playgroud)

那些"200"的单位是多少?是px/dp吗?
它在每台设备上看起来都"一样"吗?(这意味着:它在平板电脑上是非常大的,在智能手机上是非常小的吗?)

java android width layoutparams

5
推荐指数
1
解决办法
2439
查看次数

levelplot框线宽R.

有没有人知道如何更改levelplot图形的线宽,特别是多个面板的线宽?箱线宽度应与刻度线一起变化.在基地R可以使用plot(x);box(lwd=10).

这是否可以在levelplot中?

非常感谢.

library(rasterVis)
mycolors=c("darkred","red3", "orange", "yellow", "lightskyblue", 
          "royalblue3","darkblue")
s <- stack(replicate(6, raster(matrix(runif(100), 10))))
levelplot(s, layout=c(3, 2), col.regions=mycolors, index.cond=list(c(1, 3, 5, 2, 4, 6)))
Run Code Online (Sandbox Code Playgroud)

r width lattice levelplot box

5
推荐指数
1
解决办法
4892
查看次数

textView动态更改为较短的文本而不是ellipsize

我有这个代码:

  final ViewTreeObserver[] viewTreeObserver = {myAcco    
    viewTreeObserver[0].addOnPreDrawListener(
        new OnPreDrawListener() {
          @Override
          public boolean onPreDraw() {
            int chipWidth =
                myAccountView.getMeasuredWidth()
                    - myAccountView.getPaddingLeft()
                    - myAccountView.getPaddingRight();
            if (chipWidth > 0) {
              myAccountView.setText(
                  setChipTextWithCorrectLength(
                      getContext().getString(R.string.og_my_account_desc_long_length),
                      getContext().getString(R.string.og_my_account_desc_meduim_length),
                      getContext().getString(R.string.og_my_account_desc_short_length),
                      chipWidth));
              viewTreeObserver[0] = myAccountView.getViewTreeObserver();
              if (viewTreeObserver[0].isAlive()) {
                viewTreeObserver[0].removeOnPreDrawListener(this);
              }
            }
            return true;
          }
        });
  }

  @VisibleForTesting
  String setChipTextWithCorrectLength(
      String longDesc, String mediumDesc, String shortDesc, int clipWidth) {
    if (!isTextEllipsized(longDesc, clipWidth)) {
      return longDesc;
    }
    if (!isTextEllipsized(mediumDesc, clipWidth)) {
      return mediumDesc;
    }
    return shortDesc;
  }

  private boolean isTextEllipsized(String …
Run Code Online (Sandbox Code Playgroud)

user-interface android width textview android-viewtreeobserver

5
推荐指数
1
解决办法
195
查看次数