我真的是 android 的新手,正在使用其中一个 google 模板从事一个小项目;带有选项卡的选项卡式活动......有没有办法隐藏标题部分(tabbedExample)并只保留选项卡?
样式文件
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Run Code Online (Sandbox Code Playgroud)
清单文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="c.example.jinzunza.tabstoolbars">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud) 我有一个看起来像这样的字符串,它们是表中的 ID:
1,2,3,4,5,6,7,8,9
Run Code Online (Sandbox Code Playgroud)
如果有人从数据库中删除了某些内容,我将需要更新字符串。我知道这样做会删除值,但不会删除逗号。知道如何检查 id 前后是否有逗号,这样我的字符串就不会中断吗?
$new_values = $original_values[0];
$new_values =~ s/$car_id//;
Run Code Online (Sandbox Code Playgroud)
结果:1,2,,4,5,6,7,8,9使用上述样本(差)。应该是1,2,4,5,6,7,8,9。
我知道这个问题已经被问过很多次了,但是我尝试了大多数解决方案,但没有一个对我有用。这是我第一次使用android studio 3.1.3,并且正在遵循有关如何使用android studio中的基本模板选项创建简单应用程序的教程。我面临的问题是;

渲染问题无法在当前主题中找到样式“ coordinatorLayoutStyle”
我尝试将其添加到build.gradle文件中:
编译'com.android.support:design:24.1.1'
还将其放入style.xml
<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>
Run Code Online (Sandbox Code Playgroud)
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
Couldn't resolve resource @style/Widget.Design.CoordinatorLayout<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Run Code Online (Sandbox Code Playgroud)
build.gradle
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.notes"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release { …Run Code Online (Sandbox Code Playgroud) android android-studio material-design android-coordinatorlayout
我在我的应用上有一个videoview,我使用gogole作为参考来使视频播放器全屏显示:
https://developer.android.com/training/system-ui/immersive#java
我从上面的网站关注了instruccion,并且能够将视频播放器全屏显示,但是我的媒体控制器和设备控制器出现了一个奇怪的问题(它们过大),并且不知道如何解决任何想法。问题。
public class VideoPlayer extends AppCompatActivity {
VideoView videoView;
MediaController mediaController;
private String TAG = VideoPlayer.class.getSimpleName();
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.video_player_activity);
videoView = (VideoView) findViewById(R.id.videoView);
mediaController = new MediaController(this);
videoView.setVideoPath("android.resource://" + getPackageName() + "/" + R.raw.video1);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.start();
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
hideSystemUI();
}
}
private void hideSystemUI() {
View decorView = getWindow().getDecorView();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN …Run Code Online (Sandbox Code Playgroud) 下面的代码是一个简单的搜索。我试图计算列表上可见的“ li”,并在div“ totalClasses”中显示总数。然后,当用户搜索类别时,只更新可见类别的总数(li)。
我试过这样做('li:visble'),但是没有用。
ul = document.getElementById('myUl');
li = ul.getElementsByTagName('li');
aa = ul.getElementsByTagName('li:visible');
document.getElementById('totalClasess').innerHTML = (aa.length) + " Results";
function search() {
var input, filter, ul, li, a, aa;
input = document.getElementById('myInput');
filter = input.value.toUpperCase();
ul = document.getElementById('myUl');
li = ul.getElementsByTagName('li');
for (var i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName('a')[0];
if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = '';
} else {
li[i].style.display = 'none';
}
}
}Run Code Online (Sandbox Code Playgroud)
<input type="text" id="myInput" onkeyup="search()" placeholder="Search for a class..." title="Type …Run Code Online (Sandbox Code Playgroud)当用户单击表单时,我试图显示并隐藏表单,并尝试向下滚动以查看表单,我在第一次单击后工作的代码.如果我第一次点击它"显示表单但不向下滚动"第一次点击后工作正常.谁能解释我,我做错了什么.
$('#showForm').click(function()
{
$('.formL').toggle("slow");
$('.formL').get(0).scrollIntoView()
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<div class="formL" style="display: none">
<form action="">
First name:<br>
<input type="text" name="firstname" value="Mickey">
<br>
Last name:<br>
<input type="text" name="lastname" value="Mouse">
<br><br>
<input type="submit" value="Submit">
</form>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个包含中文文章列表的数据库,当我尝试查询以获取所有文章名称时遇到问题,我看到的只是 ??? 而不是中文文本。
my $db_connection = DBI->connect("DBI:mysql:host=localhost;database=articles", 'root', '');
my $con = $db_connection->prepare( "select * from articles" );
$con->execute;
while (my $infoD = $con->fetchrow_hashref())
{
$INFO{$infoD->{name}} .= decode('utf8', $infoD->{name});
}
Run Code Online (Sandbox Code Playgroud) 我遇到了问题,尝试在鼠标单击图像时显示鼠标位置x / y,im使用了相位器提供的单击和图像示例之一。
这是代码
var game = new Phaser.Game(800, 500, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });
var text;
var counter = 0;
function preload () {
// You can fill the preloader with as many assets as your game requires
// Here we are loading an image. The first parameter is the unique
// string by which we'll identify the image later in our code.
// The second parameter is the URL of the image (relative)
game.load.image('Happy-face', 'happy.png'); …Run Code Online (Sandbox Code Playgroud) 我正在使用 Perl 从数据库读取数据(我是 Perl 新手),其中一列是 JSON 数组。我遇到的问题是,当我尝试读取 JSON 中的数据时,出现错误“子例程条目中的宽字符”。
桌子:
编号 | 名称 | 日期 | 数据
样本数据。
{ "duration":"24", "name":"我的测试","visible":"1" }
use JSON qw(decode_json);
my $current_connection = $DATABASE_CONNECTION->prepare( "SELECT * FROM data WHERE syt = 'area1' " );
$current_connection->execute();
while( my $db_data = $current_connection->fetchrow_hashref() )
{
my $name = $db_data->{name};
my $object = decode_json($db_data->{data});
foreach my $key (sort keys %{$object}) {
my $result;
$pages .= "<p> $result->{$key}->{name} </p>";
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个具有多个级别的数组,每个数组都是一个“天”,并且每天都有不同的事件(catalogo),目录是一个包含当天要提供的食物的数组。我遇到的问题是试图显示目录中的数据;
(4) [Array(7), Array(7), Array(7), Array(7)]
0: Array(7)
0: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
1: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
2: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
3: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
4: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
5: {fecha: 2019, id: 1553410800, mes: 3, catalogo: Array(1), …}
6:
fecha: 2019
id: 1553410800
mes: 3
catalogo: Array(2)
0: {id: "1553929200", …Run Code Online (Sandbox Code Playgroud) 我一直在执行此sql查询。我要检查尚未投票的用户。我正在尝试类似的方法,但是没有用。
usuarios table
----------------------
| id | username |
----------------------
votes
--------------------------------------------
| id | user | mes | ano |
SELECT DISTINCT a.username
FROM usuarios a
, votes b
WHERE a.username != b.user
AND b.ano = 2019
AND b.mes = 11
on my usuarios table i hvae 20 entries.
1 | user1
2 | user2
........
on my votes table
1 | user1 | 11 | 2019
Run Code Online (Sandbox Code Playgroud)
并与查询我想只从(usuarios表)中获得不在我的票表上的用户;