After knowing that a list-item element cannot be display: flex at the same time, I wrap my contents with a container, then put the container inside the <li />.
Things go right for elements with content.
However, if the first element in the container has no child nodes, the marker of the <li /> is unexpectedly located at the bottom.
Though in my case I can simply add a display: none to workaround, I'm still confused:
How can …
我在GridView控件的模板列中有一个DropDownList.GridView绑定到对象列表.每个对象都有一个int类型的属性,它对应于一个DropDownLists ListItems中的值.我可以通过在下拉列表中添加DataBind事件来以编程方式设置所选项目,但我想知道是否有办法通过在aspx标记中使用代码块来设置所选项目.
我只是好奇.为什么需要密封ASP.NET ListItem类?
看一下 -
它可以在IE和Chrome中运行,但不能在firefox 4中运行,有人知道为什么吗?我发现了类似的东西,但不知道如何使它工作?谢谢你的帮助 !
任何人都可以帮助我在不使用List的情况下通过SharePoint中的唯一ID获取列表项吗?我知道列表项唯一ID,但我没有关于列表的信息.使用客户端对象模型我可以执行以下操作:
using (SP.ClientContext clientContext = new SP.ClientContext(...))
{
**SP.List list = clientContext.Web.Lists.GetById(listId);**
SP.ListItem listItem = list.GetItemById(listItemId);
clientContext.Load(listItem);
clientContext.ExecuteQuery();
...
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,在这段代码中我使用listId,但问题是在我的任务中我不知道listId,我只有ListItem Guid.由于我有唯一的ID,我相信必须有一种方法来获取此项而不使用任何其他信息.
我是Windows手机开发的新手.
我在列表框中显示数据.对于列表框中的所有行,背景颜色相同.但我想为备用行添加两种不同的颜色来列出框项目.
下面是列表视图的代码.
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10,0,0" Background="White">
<ListBox Margin="6,6,-6,6" Name="itemslb" SelectionChanged="itemList_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid x:Name="listItem">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" Height="100" Margin="0,10,0,0">
<StackPanel Width="85" Height="100" >
<StackPanel.Background>
<ImageBrush x:Name="defImage" ImageSource="/DailyFeeds;component/Images/default.png" Stretch="None"></ImageBrush>
</StackPanel.Background>
<Image Source="{Binding ImageUrl}" VerticalAlignment="Top" Height="90" Width="85" Margin="0,0,10,0" Stretch="Fill" />
</StackPanel>
<StackPanel Width="370">
<TextBlock Text="{Binding Title}" Foreground="SlateBlue" FontSize="25" TextWrapping="Wrap" />
<TextBlock Text="{Binding Date}" Foreground="#FFC8AB14" FontSize="20"/>
</StackPanel>
</StackPanel>
<Image x:Name="line" Grid.Row="1" Width="460" HorizontalAlignment="Center" Margin="0,5,0,0" Source="/DailyFeeds;component/Images/separator.png" />
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
Run Code Online (Sandbox Code Playgroud)
我们怎么做到这一点.
谢谢
我正在构建一个小的Android应用程序,我想在textview下显示文本.我似乎无法得到它.此时文本位于列表项的右侧.我希望带有id的视图,"list_size"低于标题.这是代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:background="?android:attr/activatedBackgroundIndicator"
>
<!--suppress AndroidLintContentDescription -->
<ImageView android:id="@+id/imageone"
android:layout_width="@dimen/list_item_image"
android:layout_height="@dimen/list_item_image"
android:layout_centerVertical="true"
android:scaleType="fitXY"/>
<TextView android:id="@+id/title" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:fontFamily="sans-serif-light"
android:textIsSelectable="false" android:layout_marginLeft="7dp"
android:layout_toRightOf="@+id/imageone" android:textSize="@dimen/medium_text_size"
android:singleLine="true" android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/divider"/>
<View android:id="@+id/divider"
android:layout_toLeftOf="@+id/list_size"
android:layout_width="1dp"
android:layout_height="10dp"/>
<TextView android:layout_marginLeft="5dp"
android:id="@+id/list_size" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:textSize="@dimen/small_text_size"
android:singleLine="true" android:fontFamily="sans-serif-light"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我是一名开始在 Angular 5 上训练的学生。我想即使在 Angular 2 上我的问题也可能是一样的。
对于一个项目,我目前正在尝试创建一个简单的搜索输入,用户可以在其中写入城市名称,并且该字段将在下面建议一些名称。然后,当用户单击列表中的某个项目时,它将显示在输入中。实际上它的行为应该与谷歌搜索栏非常相似。
这是砰的一声。我想它不会运行得很顺利,因为我只是放置了正确的文件来理解,而不是我的整个应用程序。
这是我的文件:input-form.component.html:
<input
type="text"
class="form-control"
id="InputCity"
[(ngModel)]="searchText"
formControlName="city"
(click)="displayCities()">
<ul class="results">
<li>
<a
class="list-group-item"
style="cursor: pointer"
*ngFor="let city of citiesListInput | filter : searchText"
(click)="putIntoField(city)">
{{ city }}
</a>
</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
input-form.component.ts(简而言之):
export class InputFormComponent implements OnInit {
citiesListInput: string[];
constructor(private citiesSvc: CitiesService) { }
//Get list of cities from a service//
displayCities() {
this.citiesListInput = this.citiesSvc.citiesList;
}
//Should send the city clicked in the list in the input field.// …Run Code Online (Sandbox Code Playgroud) 我对 Material UI 和 React 很陌生。我有一个非常奇怪的 UI 问题,我希望这里有人能指出我做错了什么。
我在做什么: 我有一个列表。对于每个列表项,我想要一些按钮指向不同的 URL。这是我的列表的代码。这有点伪代码。每个“列表项”都是使用映射生成的,该映射遍历以 JSON 格式保存的数据:
<List>
<ListItem button component="a" href={infoUrl}>
<ListItemAvatar>
<Avatar src={itemIcon} />
</ListItemAvatar>
<ListItemText
primary={this.props.project.name_with_namespace}
secondary={this.props.project.description}
/>
<ListItemSecondaryAction>
<Tooltip id="button-report" title="Report">
<IconButton area-label="Report" href={reportUrl}>
<AssessmentIcon />
</IconButton>
</Tooltip>
<Tooltip id="button-codeRepo" title="Code Repository">
<IconButton area-label="Code Repository" href={repoUrl}>
<CodeIcon />
</IconButton>
</Tooltip>
</ListItemSecondaryAction>
</ListItem>
</List>
Run Code Online (Sandbox Code Playgroud)
问题:列表显示所有列表项。主要和次要文本以及每个列表项的头像也正确显示,包括 2 个“图标按钮”。
问题是,被添加到工具提示IconButton下ListItemSecondaryAction。对于第一个列表项,一切都很好。对于所有其他列表项,我必须将鼠标指针移动到图标按钮的底部边缘,以便能够单击并查看工具提示。
如果我完全删除工具提示,则点击不会有任何问题。我可以将鼠标指针移动到图标按钮圆环内的中间或其他区域,然后单击。
我在Tooltip这里没有正确使用吗?尝试了 Chrome 和 FireFox 并看到相同的问题。
如何重置嵌套有序列表的编号。
运行此代码段,给我这样的输出:
清单3
清单3
清单3
3.1. List 1
3.2. List 2
3.3. List 3
3.3.1. List 1
3.3.2. List 2
3.3.3. List 3
3.3.3.1. List 1
3.3.3.2. List 2
3.3.3.3. List 3
Run Code Online (Sandbox Code Playgroud)我希望3.1从1开始。我该如何做?我需要使用多个计数器吗?还是一个会做?我不太习惯使用CSS计数器。如果代码是一系列嵌套的有序列表,则该代码有效,但是当内部有无序列表时,该代码将开始失败。它仍然从先前的有序列表继续编号。
3.1. List 1
3.2. List 2
3.3. List 3
3.3.1. List 1
3.3.2. List 2
3.3.3. List 3
3.3.3.1. List 1
3.3.3.2. List 2
3.3.3.3. List 3
Run Code Online (Sandbox Code Playgroud)
ol {
counter-reset: item 0;
list-style: none;
}
ul {
counter-reset: item "";
} …Run Code Online (Sandbox Code Playgroud)listitem ×10
css ×4
asp.net ×2
html ×2
android ×1
angular ×1
data-binding ×1
firefox ×1
flexbox ×1
html-lists ×1
javascript ×1
layout ×1
listbox ×1
material-ui ×1
sealed ×1
sharepoint ×1
tooltip ×1
unique-id ×1
xml ×1