EditText我的代码中有一些,我想让它的底部边框更薄一些.在互联网上找不到任何关于它的信息,也许这里的任何人都可以帮助我.
是)我有的:

我想要的是:

我的状态栏出了问题,工具栏重叠了.
我想要的功能是,当用户ListView向下滚动时,工具栏会消失在状态栏后面,这样只有选项卡可见,就像在WhatsApp和YouTube应用程序中一样.
为了达到这个效果或获得这个功能,我使用了这一行:
app:layout_scrollFlags="scroll|enterAlways"
Run Code Online (Sandbox Code Playgroud)
进入我的android.support.v7.widget.Toolbar,但我之前说过,状态栏会被工具栏重叠.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
感谢任何帮助!
更新:
V21\styles.xml
<resources>>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. --> …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试编写一个消息传递应用程序,并发现了一个我已经被困了两个星期的错误而且无法到达任何地方.
该应用程序的工作方式如下:联系用户时,应将两个用户的状态设置为"已阻止",以便其他任何人都无法联系他们.这是我在程序中实现它的方式:
发送按钮:
openNewChatButton = (Button) findViewById(R.id.mainSendButton);
openNewChatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String checkText = sendMainMessage.getText().toString();
if (checkText.isEmpty()) {
Toast.makeText(MainActivity.this, "Bitte verfasse vorher eine Nachricht.", Toast.LENGTH_SHORT).show();
} else {
sendMessageToUser();
}
}
});
Run Code Online (Sandbox Code Playgroud)
创建消息并发送它:
public void sendMessageToUser() {
mUsersDatabaseForRandomChatUser.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
key = sampleUserID;
if (current_uid.equals(key) || key == null || key == "") {
Toast.makeText(MainActivity.this, "Keinen passenden Chatpartner gefunden!", Toast.LENGTH_SHORT).show();
} else {
Intent newMessageIntent = new Intent(MainActivity.this, ChatActivity.class); …Run Code Online (Sandbox Code Playgroud) java android android-activity firebase firebase-realtime-database
我一直坚持这个问题超过一个星期了,找不到解决方法,因为我对.NET和角度环境都很陌生.此外,我无法在互联网上找到适合我的问题的解决方案.
我有一个服务,通过REST api每秒向我发送数据.我想在客户端中检索此数据,而无需连续重新加载整个页面.因此我选择了SignalR.
到目前为止一切正常并且与集线器的连接已建立.但是当我尝试从集线器调用该方法时,我收到一条错误消息:
Invoking 'GetPerformanceSnapshotData' failed. Rejecting promise...
Promise rejected.
ErrorObservable {_isScalar: false, error: Error: An error occurred while sending the request.
at Object.error (http://localhost:4200/scrip......, scheduler: undefined}
error: Error. An error occurred while sending the request: An error occurred while sending the request. at Object.error (http://localhost:4200/...)...
Run Code Online (Sandbox Code Playgroud)
这是我在客户端上的调用方法:
public GetPerformanceSnapshotData() {
this.connect().then((connection) => {
this.invoke("GetPerformanceSnapshotData").then((data: string) => {
console.log(data);
}).catch(error => {
this.dialogService.showError(error);
return Observable.throw(error);
});
}).catch(error => {
this.dialogService.showError(error);
return Observable.throw(error);
});
}
}
Run Code Online (Sandbox Code Playgroud)
服务器端方法如下所示:
namespace ...
{
using …Run Code Online (Sandbox Code Playgroud)