我正在使用Sherlock寻呼机指示器并且寻呼机中的圆圈看起来不够圆(我尝试了不同的颜色,你仍然可以看到它们不是圆的).

这是我一直用来的风格 CircleIndicator
<style name="CustomCirclePageIndicator">
<item name="fillColor">@color/light_blue</item>
<item name="unselectedColor">@android:color/white</item>
<item name="centered">true</item>
<item name="strokeColor">@null</item>
<item name="pageColor">@android:color/white</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我想实现以下结果(但使用不同的颜色):

这是布局xml
<?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="match_parent"
android:background="@color/brown"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/top_layout"
android:layout_width="fill_parent"
android:layout_height="170.00dp"
android:background="@color/light_blue" >
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:background="@drawable/login_logo" />
<TextView
android:id="@+id/logo_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/logo"
android:layout_centerHorizontal="true"
android:text="..."
android:textSize="16sp" />
</RelativeLayout>
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/titles"
android:layout_below="@id/top_layout"
android:layout_centerHorizontal="true"
android:overScrollMode="never" >
</android.support.v4.view.ViewPager>
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/titles"
style="@style/CustomCirclePageIndicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我有一个RecyclerView包裹在一个LinearLayout,它按预期完美地工作.我可以看到RecyclerView填充的所有数据.到现在为止还挺好.
当我裹LinearLayout在ScrollView,在RecyclerView一片空白.我内心没有看到任何东西RecyclerView.为什么?如何使这项工作.
该页面是a中的一个选项卡ViewPagerIndicator,因此该选项卡中的所有内容都必须位于ScrollView.
谢谢你的帮助.
我的布局中有一个viewpager,viewpager包含一组10个片段.每个片段都有一个列表视图,该视图是异步填充的.我目前正在使用FragmentPagerAdapter作为viewpager的适配器,并且填充列表视图的API调用是在每个片段的onCreateView中完成的.由于内存问题,滑动非常慢并且应用程序自行关闭.
如何实现像Google Play一样流畅和响应(viewpager + listview)呢?顺利刷卡+列表项的良好缓存?

android android-fragments android-viewpager google-play viewpagerindicator
我正在尝试将Jack Whartons ViewPagerIndicator库https://github.com/JakeWharton/ViewPagerIndicator添加 到我的应用程序中,因为我想使用我拥有的viewpager的圆形指示器.但是我无法将其添加到我的应用程序.我已经按照本教程 - 在Android Studio和Gradle中使用ViewPagerIndicator库
但是我收到了这个错误
Error:Artifact 'library.aar (com.viewpagerindicator:library:2.4.1)' not found.
Searched in the following locations:
https://jcenter.bintray.com/com/viewpagerindicator/library/2.4.1/library-2.4.1.aar
Run Code Online (Sandbox Code Playgroud)
如果我删除jCenter()我的gradle 中的代码然后它的工作原理,但我所包含的其他依赖项没有,所以我不知道如何让所有的依赖项一起工作.
这是我的顶级gradle文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories { …Run Code Online (Sandbox Code Playgroud) android gradle maven viewpagerindicator android-gradle-plugin
我遇到了ViewPager的另一个问题,我现在的知识无法解决它.
我有TabPageIndicator和ViewPager,在每个标签上,我都显示文字.这是简单的textView:
<?xml version="1.0" encoding="utf-8"?>
<view xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
class="viewpagerindicator.TabPageIndicator$TabView" >
<TextView
android:id="@+id/vpi_tab_text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center"
android:paddingBottom="10dip"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:paddingTop="10dip"
android:textColor="@drawable/vpi_tab_text_color"
android:typeface="serif" />
</view>
Run Code Online (Sandbox Code Playgroud)
我希望选项卡中的文本始终是一行,并且始终是整个文本,而不是椭圆形,不包装,不超过1行.用户需要能够全部阅读...
但我不能这样做,我尝试了不同的选项,但我仍然遇到一些问题 - 文本不仅仅有一行,而且只显示第一行,或者只显示部分文本.
你有过类似的经历吗?
任何帮助表示赞赏
编辑一:
我相信问题在这里:
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
final boolean lockedExpanded = widthMode == MeasureSpec.EXACTLY;
setFillViewport(lockedExpanded);
final int childCount = mTabLayout.getChildCount();
if (childCount > 1 && (widthMode == MeasureSpec.EXACTLY || widthMode == MeasureSpec.AT_MOST)) {
if (childCount > 2) {
mMaxTabWidth = …Run Code Online (Sandbox Code Playgroud) android tabpage indicator android-viewpager viewpagerindicator
现在我正在使用ViewPagerIndicator在我的程序中使用指示器的可滑动片段,它就像一个魅力.但是,由于Google在不使用Android支持库的情况下越来越多地朝着Fragments的方向发展,例如支持库中没有PreferenceFragments,我想知道是否有类似于使用标准Android库的ViewPagerIndicator.
android viewpage android-fragments android-viewpager viewpagerindicator
我制作了一份时间表申请表
安卓我正在使用ViewPagerIndicator作为片段.但现在我有一个问题,我想把TabPageIndicator放到中心.像这样:

我想设置单个标签的宽度和高度.并将该选项卡设置为支持选定/按下状态的drawable.
我还没有找到解决这些问题的方法.我尝试的东西onPageSelected和ContextThemeWrapper,但不工作.(也许我没有正确使用它).
除了ViewPagerIndicator之外,这一切都有可能成为或者我应该寻找其他东西吗?(也欢迎没有ViewPagerIndicator的其他选项).
图片上的应用程序是Untis Mobile,可以在PlayStore上找到.我已经问过创作者他们是怎么做的,但是他们说应用程序不是开源的.(但我在源代码中发现他们使用TwoDScrollView来做,但我不确定)
编辑:
造型固定vpiTabPageIndicatorStyle.(在XDA开发人员的帮助下!)
当我添加20个项目时,它会保留在中间但仅从项目4到项目17,项目1,2,3,18,19,20不在中间.看到:
我可以添加3个空项目(或空白区域)以确保第一个和最后一个项目位于中间吗?像这样的东西(来自Untis Mobile应用程序):
(我已经尝试过android:paddingLeft,vpiTabPageIndicatorStyle但这不起作用)
我知道这viewPager.setCurrentItem(total/2)会将TabPageIndicator设置在中间,但是它会保持在中间位置,我无法选择其他一天(我称之为onPageScrolled).所以我想滚动选中的一个需要在中间.这可能吗?
java android horizontalscrollview android-scrollview viewpagerindicator
我正在使用Jake Wharton的ViewpagerIndicator库.我将选项卡代码与ActionBarSherlock库结合使用.一切正常,但我试图设置选项卡的背景,无法弄清楚如何.我想要一个带有深色标签和浅色片段(标签内容)的黑暗动作栏.
我使用的基本主题是Theme.Sherlock.Light.DarkActionBar.我通过使其成为设置选项卡属性的样式的父级(如文本颜色,指示器颜色等)来扩展此样式.这会导致暗动作条,光标和光碎片.
我找不到任何会改变标签背景的东西.我可以改变它的唯一方法是将整个应用程序更改为黑暗(使用Theme.Sherlock).到目前为止,这是我的代码:
<style name="vpiTheme" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="vpiTabPageIndicatorStyle">@style/CustomTabPageIndicator</item>
</style>
<style name="CustomTabPageIndicator" parent="Widget.TabPageIndicator">
<item name="android:textColor">#FF000000</item>
<item name="android:paddingTop">6dp</item>
<item name="android:paddingBottom">6dp</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:maxLines">2</item>
</style>
Run Code Online (Sandbox Code Playgroud) 我正在使用ViewPagerIndicator ,我想更改选项卡样式,以便我可以获得文本上方的图标,而不是默认设置,将图标放在左侧,标题放在右侧.
我注意到最新版本的ViewPagerIndicator,支持ICS样式分隔符,我试图按照问题和解决方案,但无论我做什么,我都无法让分隔符出现在TitlePageIndicator操作栏上的选项上.我添加了IcsLayout作为容器,放置了divider,showDividers和其他属性,但我仍然一无所获.这是我的布局(奇怪的是,如果我将IcsLayout切换到viewpager指示器,应用程序崩溃):
<com.actionbarsherlock.internal.widget.IcsLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.sosick.android.brink"
android:layout_width="match_parent"
android:divider="#ffffff"
android:showDividers="middle"
android:dividerPadding="8dp"
android:dividerHeight="10dp"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.viewpagerindicator.TitlePageIndicator
android:id="@+id/tpi_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
textColor="@color/text_light"
android:background="@drawable/ab_stacked_solid_brink"
app:topPadding="10dp"
app:footerPadding="15dp"
app:footerColor="#a4ded7"
app:footerIndicatorHeight="2dp"
app:footerIndicatorStyle="underline"
app:footerLineHeight="2dp"
app:selectedBold="false" />
<android.support.v4.view.ViewPager
android:id="@+id/vp_pages"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</com.actionbarsherlock.internal.widget.IcsLinearLayout>
Run Code Online (Sandbox Code Playgroud) android android-viewpager actionbarsherlock viewpagerindicator