如何更改微调器右下角的小三角形颜色,如图所示?它现在显示默认的灰色.像这样
我有一个JSON字符串,我从Facebook API获得,其中我有一个节点,其名称根据其内容而变化,例如一段时间它是45,或58等.它可以是任何数字.我想要它的价值.怎么弄?例:
{
"data": [
{
"id": "1492292372_10201810786059989",
"created_time": "2014-04-05T09:00:54+0000"
},
{
"id": "1492292372_10201804679827337",
"created_time": "2014-04-04T07:29:07+0000"
},
{
"id": "1492292372_10201804649306574",
"created_time": "2014-04-04T07:10:33+0000"
},
{
"id": "1492292372_10201801316823264",
"created_time": "2014-04-03T18:31:50+0000"
},
{
"id": "1492292372_10201798962284402",
"created_time": "2014-04-03T06:24:47+0000"
},
{
"message_tags": {
"0": [
{
"id": "1492292372",
"name": "Yawar Sohail",
"type": "user",
"offset": 0,
"length": 12
}
],
"15": [
{
"id": "1489845168",
"name": "Zeeshan Anjum",
"type": "user",
"offset": 15,
"length": 13
}
]
},
"id": "1492292372_10201796274777216",
"created_time": "2014-04-02T17:57:05+0000"
},
{
"id": "1492292372_10201794080482360",
"created_time": …
Run Code Online (Sandbox Code Playgroud) 尽管它在do-catch
块内,但下面的代码正在崩溃(并非总是但很少)。
Fabric crashlytics
指出异常是Fatal Exception: NSInternalInconsistencyException
,有时是这样EXC_BAD_ACCESS KERN_PROTECTION_FAILURE 0x000000016fccb1f8
do {
return try NSAttributedString(
data: data,
options: [
.documentType: NSAttributedString.DocumentType.html,
.characterEncoding: String.Encoding.utf8.rawValue
],
documentAttributes: nil
)
} catch {
return NSAttributedString()
}
Run Code Online (Sandbox Code Playgroud)
虽然我阅读了NSAttributedString
它的苹果文档,但它指出它应该在主线程上,所以我用Dispatch.main.async
块包围它,但这样做并没有设置设置的样式NSAttributedString
我有一个垂直的自定义列表,垂直列表的每个项目都包含一个水平列表视图。当我水平滚动时,列表也会垂直移动。这使得它不那么用户友好。我可以在水平滚动时禁用垂直滚动吗?我在用
<com.devsmart.android.ui.HorizontalListView
android:id="@+id/hlistview"
android:layout_width="match_parent"
android:layout_height="155dp"
android:layout_margin="6dp"
android:background="#fff"
android:fitsSystemWindows="true"
/>
Run Code Online (Sandbox Code Playgroud)
用于水平列表视图
我在我的xaml中定义了这个内容对话框:
<ContentDialog x:Name="AlertMessage" Background="#363636" IsSecondaryButtonEnabled="True" SecondaryButtonText="Cancel" IsPrimaryButtonEnabled="True" PrimaryButtonText="Ok" >
<ContentDialog.Content>
<StackPanel Name="rootStackPanel" Height="Auto" >
<StackPanel Margin="0">
<StackPanel Margin="0,0,0,10" Orientation="Horizontal">
<TextBlock x:Name="HeadingText" x:FieldModifier="public" Style="{StaticResource ApplicationMessageBoxHeadingStyle}" Text="Alert" />
<Image Margin="10,05,0,0" Source="/Assets/Images/alert.png" Width="35"></Image>
</StackPanel>
<TextBlock x:FieldModifier="public" x:Name="ContentText" Style="{StaticResource ApplicationMessageBoxErrorStyle}" Text="Are you sure you want to log off ?" />
</StackPanel>
</StackPanel>
</ContentDialog.Content>
</ContentDialog>
Run Code Online (Sandbox Code Playgroud)
而我这样称呼它:
private void AppBarButton_Click(object sender, RoutedEventArgs e)
{
MessageBox();
}
private async void MessageBox()
{
ContentDialogResult LogoutDialog = await AlertMessage.ShowAsync();
if (LogoutDialog == ContentDialogResult.Primary)
{
this.Frame.Navigate(typeof(MainPage));
}
else
{
// …
Run Code Online (Sandbox Code Playgroud) <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="?android:attr/actionBarSize"
android:background="@drawable/stalker_background"
android:focusableInTouchMode="true" >
<ProgressBar
android:id="@+id/pb"
android:layout_height="75dp"
android:layout_width="75dp"
android:layout_gravity="center"
android:indeterminate="true"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ScrollView
android:id="@+id/svProfile"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/VPSlider"
android:layout_width="match_parent"
android:layout_height="175dp"
/>
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
</LinearLayout>
</ScrollView>
</LinearLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
进度条出现在屏幕的角落,如何将其对齐在屏幕中央.我有相对布局,我在屏幕上显示一些东西之后删除了这个进度条,这就是为什么我需要在其他控件之上.