我有一个listview我需要修复listview的列宽,以便在运行时用户无法拖动列表并调整大小.....程序是什么?我搜索了所有的属性,但没有一个帮助我解决这个pbm ..这在gridview中是可能的但是如何在listview中实现....
有rich:modalPanel面板组件:
<rich:modalPanel id="pnl" zindex="10000" height="510" width="400" style="overflow: scroll" onresize="return false;">
Run Code Online (Sandbox Code Playgroud)
此面板的内容以宽度显示不完整,因此显示滚动ID.
如何适应宽度以避免水平滚动?
尝试:
style="overflow: auto" -
style="overflow: visible"透明背景,没有正确显示
我试图将div的宽度和高度设置为完全等于我的用户屏幕的大小.怎么做到呢.我应该使用jquery吗?如果是这样,怎么样?
我有以下布局并调用该布局.在某一点上,这个相同的代码将填充父布局的宽度,即一个选项卡.现在它没有,我无法弄清楚为什么.它阻止我发布我的最新版本.欢迎任何和所有输入.
section_title.xml:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/seasonTitle"
android:padding="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#FFFFFFFF"
android:textSize="14sp"
android:textStyle="bold"
android:maxHeight="26sp"
android:background="#FFCC3333"
/>
Run Code Online (Sandbox Code Playgroud)
这是一个如何调用它的片段:
TextView titleTv = (TextView)mInflater.inflate(R.layout.section_title, null);
titleTv.setText(titleText);
mMergeAdapter.addView(titleTv);
Run Code Online (Sandbox Code Playgroud)
谢谢!
我正在活动中显示来自数据库的数据。我想要一个表格和底部的按钮。对于数据,TableLayout将是最佳选择。我将TableLayout添加到HorizontalView和ScrollView中,以使其垂直和水平滚动。正在动态添加所有行-包括标题。这部分工作正常。
我要的是,当内容小于屏幕宽度时,它仍应占据整个屏幕宽度。例如。如果一张桌子非常适合“纵向”模式,那么对于“横向”模式,它们当然将是右边的空白区域。我不希望该空间eb空,而是要被所有列占用。如果行宽大于屏幕宽度,则根本没有问题-出现水平滚动条。
我尝试了几种变体,但没有任何帮助。不知道要进行什么设置以利用所有空间(如果有的话)并显示它。
是的,还有1期水平滚动条,它出现在最后一行。我希望它显示在最后一行的下面-这样就可以看到最后一行的边框。我的XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:scrollbars="horizontal|vertical">
<HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp" >
<TableLayout android:id="@+id/browseTable" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_marginBottom="20dp"
android:background="#FF0000" android:stretchColumns="1,2,3">
</TableLayout>
</HorizontalScrollView>
</ScrollView>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal" android:gravity="center"
android:layout_marginTop="15dp">
<Button android:id="@+id/browseAddBtn" android:text="Add" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginRight="10dp" />
<Button android:id="@+id/browseViewBtn" android:text="Edit" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginRight="10dp" />
<Button android:id="@+id/browseReturnBtn" android:text="Return" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
输出:

我需要在orientationchange上计算屏幕宽度.
我是这样做的:
$(window).on('orientationchange', function(event){
$(this).panelWidth("orientationchange")
});
panelWidth: function (fromWhere) {
window.setTimeout(function () {
var $wrapWidth = $('div:jqmData(wrapper="true").ui-page-active').innerWidth();
console.log( $wrapWidth );
},10);
});
Run Code Online (Sandbox Code Playgroud)
我已经使用10毫秒的延迟来计算屏幕宽度,但在Android上它仍然不起作用......
我的屏幕是320x480.如果我以肖像开始并改为风景,我会得到320px.当我改回画像时,我控制480px,所以宽度似乎总是在方向实际改变之前计算.
如果可能的话,我不想增加超时.有什么其他方法可以确保$ wrapWidth仅在Android完成"转动"屏幕时计算?
感谢帮助!
编辑:
来自Jquery Mobile sourceode的一些信息:
...as the actual screen resize takes place before or after the orientation
change event has been fired depending on implementation (eg android 2.3 is
before, iphone after). More testing is required to determine if a more reliable
method of determining the new screensize is possible when orientationchange
is …Run Code Online (Sandbox Code Playgroud) 在我的javascript文件中,我有以下行:
<div id="mygraph" style="width:200px;height:100px;"></div>
Run Code Online (Sandbox Code Playgroud)
我想在两个变量中设置样式标记中的宽度和高度值,这些变量从相应的函数中获取它们的值:
var my_width = getWidth();
var my_height = getHeight();
Run Code Online (Sandbox Code Playgroud)
我怎么能做到这一点?我错过了正确的语法.先感谢您...
我想用HTML/CSS和一些javascript制作一个下拉菜单.我坚持使用li元素的宽度.它必须具有内部宽度而不是静态宽度.
问题是当我用鼠标悬停在li元素上时(为了显示下拉菜单),它正在改变他的宽度.
CSS:
#nav{
background-color: #1da8d8;
width: 100%;
max-width: 960px;
margin: 0;
padding: 0;
float: left;
}
#nav li a i {
text-align: right;
}
#nav ul {
padding: 0;
margin:0;
list-style: none;
width:12em;
z-index:99;
position:relative;
overflow:visible;
}
#nav li {
background-color: #1b9cc9;
position: relative;
line-height: 39px;
height: 40px;
width: auto;
margin: 0 5px 0 0;
float:left;
display:block;
}
#nav ul li{
background-color:#1b9cc9;
top: 20px;
width: 12em;
float: left;
}
#nav a {
color: #ffffff;
text-decoration:none; …Run Code Online (Sandbox Code Playgroud) 我想在一些Android设备中获取我的布局或视图(不是屏幕尺寸)宽度,所以我该怎么做?例如:
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingRight="8dp"
android:paddingLeft="8dp"
android:id="@+id/layout_scrol_left"/>
Run Code Online (Sandbox Code Playgroud)
我有这个布局,我想在运行时获得布局宽度和高度尺寸(在倾角),我该怎么做?
根据Apple文档,视图的最大值为
矩形的y坐标的最大值。
视图的maxX为
矩形的x坐标的最大值。
同样从Apple文档中,视图的宽度为
指定矩形的宽度。
视图的高度是
指定矩形的高度。
如果指定的视图占据了整个屏幕,那么这些属性之间有什么区别,我应该何时使用它们?